Skip to content

Commit 13c9592

Browse files
committed
Polish
1 parent 869b818 commit 13c9592

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

spring-web/src/main/java/org/springframework/web/server/adapter/HttpWebHandlerAdapter.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public void setCodecConfigurer(ServerCodecConfigurer codecConfigurer) {
129129
/**
130130
* Configure a custom {@link LocaleContextResolver}. The provided instance is set on
131131
* each created {@link DefaultServerWebExchange}.
132-
* <p>By default this is set to {@link org.springframework.web.server.i18n.AcceptHeaderLocaleContextResolver}.
132+
* <p>By default this is set to
133+
* {@link org.springframework.web.server.i18n.AcceptHeaderLocaleContextResolver}.
133134
* @param localeContextResolver the locale context resolver to use
134135
*/
135136
public void setLocaleContextResolver(LocaleContextResolver localeContextResolver) {
@@ -147,7 +148,8 @@ public ServerCodecConfigurer getCodecConfigurer() {
147148
* Return the configured {@link LocaleContextResolver}.
148149
*/
149150
public LocaleContextResolver getLocaleContextResolver() {
150-
return (this.localeContextResolver != null ? this.localeContextResolver : new AcceptHeaderLocaleContextResolver());
151+
return (this.localeContextResolver != null ?
152+
this.localeContextResolver : new AcceptHeaderLocaleContextResolver());
151153
}
152154

153155

@@ -164,7 +166,8 @@ public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response)
164166
}
165167

166168
protected ServerWebExchange createExchange(ServerHttpRequest request, ServerHttpResponse response) {
167-
return new DefaultServerWebExchange(request, response, this.sessionManager, getCodecConfigurer(), getLocaleContextResolver());
169+
return new DefaultServerWebExchange(request, response, this.sessionManager,
170+
getCodecConfigurer(), getLocaleContextResolver());
168171
}
169172

170173
private void logHandleFailure(Throwable ex) {

spring-web/src/main/java/org/springframework/web/server/i18n/AcceptHeaderLocaleContextResolver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public LocaleContext resolveLocaleContext(ServerWebExchange exchange) {
9797
if (supportedLocale != null) {
9898
return new SimpleLocaleContext(supportedLocale);
9999
}
100-
return (defaultLocale != null ? new SimpleLocaleContext(defaultLocale) : new SimpleLocaleContext(requestLocale));
100+
return (this.defaultLocale != null ? new SimpleLocaleContext(this.defaultLocale) :
101+
new SimpleLocaleContext(requestLocale));
101102
}
102103

103104
private boolean isSupportedLocale(@Nullable Locale locale) {

spring-web/src/main/java/org/springframework/web/server/i18n/FixedLocaleContextResolver.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public TimeZone getTimeZone() {
8888

8989
@Override
9090
public void setLocaleContext(ServerWebExchange exchange, @Nullable LocaleContext localeContext) {
91-
throw new UnsupportedOperationException("Cannot change fixed locale - use a different locale context resolution strategy");
91+
throw new UnsupportedOperationException(
92+
"Cannot change fixed locale - use a different locale context resolution strategy");
9293
}
9394

9495
}

0 commit comments

Comments
 (0)