Source:
<code>public void init() { String stateRepoType = System.getProperty(KieServerConstants.KIE_SERVER_STATE_REPO_TYPE, System.getenv("KIE_SERVER_STATE_REPO_TYPE")); for (KieServerStateRepository repo : serverStateRepos) { if (repo.getClass().getSimpleName().equals(stateRepoType)) { this.repository = repo; break; } } <START> <END> logger.debug("Configured '{}' server state repository", this.repository.getClass().getSimpleName()); this.context = new KieServerRegistryImpl(); this.context.registerIdentityProvider(new JACCIdentityProvider()); this.context.registerStateRepository(repository); ContainerLocatorProvider.get(); ContainerManager containerManager = getContainerManager(); KieServerState currentState = repository.load(KieServerEnvironment.getServerId()); List<KieServerExtension> extensions = sortKnownExtensions(); for (KieServerExtension extension : extensions) { if (!extension.isActive()) { continue; } try { extension.init(this, this.context); this.context.registerServerExtension(extension); if (extension.isInitialized()) { logger.info("{} has been successfully registered as server extension", extension); } else { logger.warn("{} has not been registered as server extension", extension); } } catch (Exception e) { serverMessages.add(new Message(Severity.ERROR, "Error when initializing server extension of type " + extension + " due to " + e.getMessage())); logger.error("Error when initializing server extension of type {}", extension, e); } } policyManager = new PolicyManager(); policyManager.start(this, context); kieServerActive.set(true); eventSupport.fireBeforeServerStarted(this); startTimestamp = System.currentTimeMillis(); StartupStrategy startupStrategy = StartupStrategyProvider.get().getStrategy(); logger.info("Selected startup strategy {}", startupStrategy); startupStrategy.startup(this, containerManager, currentState, kieServerActive); eventSupport.fireAfterServerStarted(this); }</code><technical_language>I this NPE upgrading additional settings - meaning this change is required set repository impl while I default file based if other is given. stateRepoType is set simply set file based skip loop. sense</technical_language>

Target:
public void init() { StartupStrategy startupStrategy = StartupStrategyProvider.get().getStrategy(); logger.info("Selected startup strategy {}", startupStrategy); for (KieServerStateRepository repo : serverStateRepos) { if (repo.getClass().getSimpleName().equals(startupStrategy.getRepositoryType())) { this.repository = repo; break; } } logger.info("Configured '{}' server state repository", this.repository.getClass().getSimpleName()); this.context = new KieServerRegistryImpl(); this.context.registerIdentityProvider(new JACCIdentityProvider()); this.context.registerStateRepository(repository); ContainerLocatorProvider.get(); ContainerManager containerManager = getContainerManager(); KieServerState currentState = repository.load(KieServerEnvironment.getServerId()); List<KieServerExtension> extensions = sortKnownExtensions(); for (KieServerExtension extension : extensions) { if (!extension.isActive()) { continue; } try { extension.init(this, this.context); this.context.registerServerExtension(extension); if (extension.isInitialized()) { logger.info("{} has been successfully registered as server extension", extension); } else { logger.warn("{} has not been registered as server extension", extension); } } catch (Exception e) { serverMessages.add(new Message(Severity.ERROR, "Error when initializing server extension of type " + extension + " due to " + e.getMessage())); logger.error("Error when initializing server extension of type {}", extension, e); } } policyManager = new PolicyManager(); policyManager.start(this, context); kieServerActive.set(true); eventSupport.fireBeforeServerStarted(this); startTimestamp = System.currentTimeMillis(); startupStrategy.startup(this, containerManager, currentState, kieServerActive); eventSupport.fireAfterServerStarted(this); }