Skip to content

Commit

Permalink
Merge pull request spring-projects#15754 from izeye
Browse files Browse the repository at this point in the history
* pr/15754:
  Polish contribution
  Polish SessionConfigurationImportSelector.selectImports()
  • Loading branch information
snicoll committed Jan 31, 2019
2 parents 002fa40 + 5269ea5 commit b4e890c
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -60,7 +60,6 @@
import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer;
import org.springframework.session.web.http.HttpSessionIdResolver;
import org.springframework.util.StringUtils;

/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Session.
Expand Down Expand Up @@ -162,13 +161,10 @@ static class CookieHttpSessionIdResolverAvailable {
abstract static class SessionConfigurationImportSelector implements ImportSelector {

protected final String[] selectImports(WebApplicationType webApplicationType) {
List<String> imports = new ArrayList<>();
StoreType[] types = StoreType.values();
for (StoreType type : types) {
imports.add(SessionStoreMappings.getConfigurationClass(webApplicationType,
type));
}
return StringUtils.toStringArray(imports);
return Arrays.stream(StoreType.values())
.map((type) -> SessionStoreMappings
.getConfigurationClass(webApplicationType, type))
.toArray(String[]::new);
}

}
Expand Down

0 comments on commit b4e890c

Please sign in to comment.