Finalize the initialization: ensure that the events are fired outside the scope of the SpaceRepository constructor.
163167
void postConstruction() {
		if (this.spaceIDs != null) {
			for (final Entry<SpaceID, Object[]> e : this.spaceIDs.entrySet()) {
				assert this.spaceIDs.containsKey(e.getKey());
				ensureLocalSpaceDefinition(e.getKey(), e.getValue());
			}
			this.internalListener = new SpaceDMapListener();
			this.spaceIDs.addDMapListener(this.internalListener);
		}
	}
1089855
def finalize(self):
        
        self.spinBox.valueChanged.disconnect(self.commitChangedValue)
        super(FloatCtiEditor, self).finalize()
481342
private void initAST() {
    jsRoot = IR.root();
    externsRoot = IR.root();
    externAndJsRoot = IR.root(externsRoot, jsRoot);
  }
1007334
public function finalize()
    {
        $this->initialize();

        if (is_resource($this->handle)) {
            fwrite($this->handle, "\n]");
            fclose($this->handle);
        }
    }
1098344
public void init() {
        try {
            initPlugin();
        } catch (RuntimeException e) {
            LOG.error("init metrics plugin error:", e);
            System.exit(-1);
        }

        pushRefreshEvent();
        pushFlushEvent();
        pushMergeEvent();
        pushUploadEvent();
        pushDiagnosisEvent();
        LOG.info("Finish");
    }
836049
private void initialize() {
		this.setJMenuBar(getMainMenuBar());
		this.setContentPane(getPaneContent());
    	this.setPreferredSize(new Dimension(1000, 800));
		this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
		this.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {
				getMainMenuBar().getMenuFileControl().exit();
			}
		});

		this.setVisible(false);
	}
562196
private void init() {
        if (ival == null) {
            this.ival = intervalFactory.getInstance(start, startGran, finish, finishGran);
            if (startSide == null) {
                startSide = Side.START;
            }
            if (finishSide == null) {
                finishSide = Side.FINISH;
            }
        }
    }
840072
def finalize(self):
        
        self.model().sigItemChanged.disconnect(self.repoTreeItemChanged)

        selectionModel = self.selectionModel() # need to store reference to prevent crash in PySide
        selectionModel.currentChanged.disconnect(self.currentItemChanged)
120742
@Override
    public void init(final String scope) throws InitializationException, InterruptedException {
        try {
            init(ScopeProcessor.generateScope(scope));
        } catch (CouldNotPerformException | NullPointerException ex) {
            throw new InitializationException(this, ex);
        }
    }
1183033
@Override
    public void afterInitialized(BaseComponent comp) {
        super.afterInitialized(comp);
        window = (Window) comp;
        sessionId = (String) comp.getAttribute("id");
        lstParticipants.setRenderer(new ParticipantRenderer(chatService.getSelf(), null));
        model.add(chatService.getSelf());
        lstParticipants.setModel(model);
        clearMessage();
        
        if (comp.getAttribute("originator") != null) {
            invite((result) -> {
                if (!result) {
                    close();
                } else {
                    initSession();
                }
            });
        }
507142
@Override
  @SuppressWarnings("unchecked")
  public void initialize() {
    LOG.initializeExecution(this);

    ScopeImpl scope = getScopeActivity();
    ensureParentInitialized();

    List<VariableDeclaration> variableDeclarations = (List<VariableDeclaration>) scope.getProperty(BpmnParse.PROPERTYNAME_VARIABLE_DECLARATIONS);
    if (variableDeclarations != null) {
      for (VariableDeclaration variableDeclaration : variableDeclarations) {
        variableDeclaration.initialize(this, parent);
      }
    }

    if (isProcessInstanceExecution()) {
      String initiatorVariableName = (String) processDefinition.getProperty(BpmnParse.PROPERTYNAME_INITIATOR_VARIABLE_NAME);
      if (initiatorVariableName != null) {
        String authenticatedUserId = Context.getCommandContext().getAuthenticatedUserId();
        setVariable(initiatorVariableName, authenticatedUserId);
      }
    }

    // create event subscriptions for the current scope
    for (EventSubscriptionDeclaration declaration : EventSubscriptionDeclaration.getDeclarationsForScope(scope).values()) {
      if(!declaration.isStartEvent()) {
        declaration.createSubscriptionForExecution(this);
      }
    }
  }
1143284
private void processInitialization() {
        ExecutorService executorService = Executors.newFixedThreadPool(this.maxThread);
        this.postInitializingMethods.entrySet().stream().sorted(Comparator.comparing(Map.Entry::getKey)).forEach(entry -> {
            log.debug("Found {} beans with max threads {} and order {}", entry.getValue().size(), this.maxThread, entry.getKey());
            try {
                executorService.invokeAll(entry.getValue());
            } catch (InterruptedException e) {
                log.warn("Failed to invoke {} method(s) on executorService {}", entry.getValue().size(), executorService);
            }
        });
        executorService.shutdown();
    }
618681
public AbstractEndpointBuilder<T> initialize() {
        if (getEndpoint() instanceof InitializingBean) {
            try {
                ((InitializingBean) getEndpoint()).afterPropertiesSet();
            } catch (Exception e) {
                throw new CitrusRuntimeException("Failed to initialize endpoint", e);
            }
        }

        return this;
    }
1214673
public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
        for (Object handler : handlerInstances) {
            Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
            Scope scope = handlerAnnotation.scope();

            runLifecycleMethods(handler, scope, scopeEnding, true);

            //dispose handler instances with a scope which matches the scopeEnding
            if (scope == scopeEnding) {
                disposeSpringResources(handler, scopeEnding);
            }
        }
    }
173023
private void initialize() {
        this.setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
        this.setContentPane(getJPanel());
       	this.setPreferredSize(new Dimension(550, 375));
        this.addWindowListener(new java.awt.event.WindowAdapter() {

        	@Override
			public void windowClosing(java.awt.event.WindowEvent e) {

        	    btnDecline.doClick();
        	}
        });

        showLicense();
	}
1226426
public void init() {
    waitForHandshake();

    availableServices = buildAvailableServices(getHostInfo());

    connect();

    // We always need a debugger, and it should never be included in the set of required services
    if (OperaDefaults.ENABLE_DEBUGGER &&
        !(requiredServices.contains(ScopeService.ECMASCRIPT) ||
          requiredServices.contains(ScopeService.ECMASCRIPT_DEBUGGER))) {
      if (availableServices.containsKey(ScopeService.ECMASCRIPT)) {
        requiredServices.add(ScopeService.ECMASCRIPT);
      } else {
        requiredServices.add(ScopeService.ECMASCRIPT_DEBUGGER);
      }
    } else {
      debugger = new MockEcmascriptDebugger();
    }

    services = createServices(requiredServices);
    enableServices(services.values());
    initializeServices(services.values());
  }
643135
public void initializeFinished() {

        // create the module manager with the configured modules
        m_moduleManager = new CmsModuleManager(m_modules);
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_MODULE_CONFIG_FINISHED_0));
        }
    }