Commit b4e890c3 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #15754 from izeye

* pr/15754:
  Polish contribution
  Polish SessionConfigurationImportSelector.selectImports()
parents 002fa405 5269ea55
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -60,7 +60,6 @@ import org.springframework.session.web.http.CookieHttpSessionIdResolver; ...@@ -60,7 +60,6 @@ import org.springframework.session.web.http.CookieHttpSessionIdResolver;
import org.springframework.session.web.http.CookieSerializer; import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer; import org.springframework.session.web.http.DefaultCookieSerializer;
import org.springframework.session.web.http.HttpSessionIdResolver; import org.springframework.session.web.http.HttpSessionIdResolver;
import org.springframework.util.StringUtils;
/** /**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Session. * {@link EnableAutoConfiguration Auto-configuration} for Spring Session.
...@@ -162,13 +161,10 @@ public class SessionAutoConfiguration { ...@@ -162,13 +161,10 @@ public class SessionAutoConfiguration {
abstract static class SessionConfigurationImportSelector implements ImportSelector { abstract static class SessionConfigurationImportSelector implements ImportSelector {
protected final String[] selectImports(WebApplicationType webApplicationType) { protected final String[] selectImports(WebApplicationType webApplicationType) {
List<String> imports = new ArrayList<>(); return Arrays.stream(StoreType.values())
StoreType[] types = StoreType.values(); .map((type) -> SessionStoreMappings
for (StoreType type : types) { .getConfigurationClass(webApplicationType, type))
imports.add(SessionStoreMappings.getConfigurationClass(webApplicationType, .toArray(String[]::new);
type));
}
return StringUtils.toStringArray(imports);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment