Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -39,6 +39,7 @@ import org.springframework.web.server.ServerWebExchange;
|
||||
* @author Sebastien Deleuze
|
||||
* @author Juergen Hoeller
|
||||
* @since 5.0
|
||||
* @see HttpHeaders#getAcceptLanguageAsLocales()
|
||||
*/
|
||||
public class AcceptHeaderLocaleContextResolver implements LocaleContextResolver {
|
||||
|
||||
@@ -76,6 +77,7 @@ public class AcceptHeaderLocaleContextResolver implements LocaleContextResolver
|
||||
|
||||
/**
|
||||
* The configured default locale, if any.
|
||||
* <p>This method may be overridden in subclasses.
|
||||
*/
|
||||
@Nullable
|
||||
public Locale getDefaultLocale() {
|
||||
@@ -128,7 +130,7 @@ public class AcceptHeaderLocaleContextResolver implements LocaleContextResolver
|
||||
return languageMatch;
|
||||
}
|
||||
|
||||
final Locale defaultLocale = getDefaultLocale();
|
||||
Locale defaultLocale = getDefaultLocale();
|
||||
return (defaultLocale != null ? defaultLocale : requestLocales.get(0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user