Merge branch '5.1.x'
This commit is contained in:
commit
3c02331983
|
|
@ -46,7 +46,7 @@ ext {
|
||||||
rxjava2Version = "2.2.7"
|
rxjava2Version = "2.2.7"
|
||||||
slf4jVersion = "1.7.26" // spring-jcl + consistent 3rd party deps
|
slf4jVersion = "1.7.26" // spring-jcl + consistent 3rd party deps
|
||||||
tiles3Version = "3.0.8"
|
tiles3Version = "3.0.8"
|
||||||
tomcatVersion = "9.0.16"
|
tomcatVersion = "9.0.17"
|
||||||
undertowVersion = "2.0.19.Final"
|
undertowVersion = "2.0.19.Final"
|
||||||
|
|
||||||
gradleScriptDir = "${rootProject.projectDir}/gradle"
|
gradleScriptDir = "${rootProject.projectDir}/gradle"
|
||||||
|
|
|
||||||
|
|
@ -780,7 +780,9 @@ public abstract class StringUtils {
|
||||||
if (tokens.length == 1) {
|
if (tokens.length == 1) {
|
||||||
validateLocalePart(localeValue);
|
validateLocalePart(localeValue);
|
||||||
Locale resolved = Locale.forLanguageTag(localeValue);
|
Locale resolved = Locale.forLanguageTag(localeValue);
|
||||||
return (resolved.getLanguage().length() > 0 ? resolved : null);
|
if (resolved.getLanguage().length() > 0) {
|
||||||
|
return resolved;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return parseLocaleTokens(localeValue, tokens);
|
return parseLocaleTokens(localeValue, tokens);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-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.
|
||||||
|
|
@ -765,4 +765,20 @@ public class StringUtilsTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInvalidLocaleWithLocaleString() {
|
||||||
|
assertEquals(new Locale("invalid"), StringUtils.parseLocaleString("invalid"));
|
||||||
|
assertEquals(new Locale("invalidvalue"), StringUtils.parseLocaleString("invalidvalue"));
|
||||||
|
assertEquals(new Locale("invalidvalue", "foo"), StringUtils.parseLocaleString("invalidvalue_foo"));
|
||||||
|
assertNull(StringUtils.parseLocaleString(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInvalidLocaleWithLanguageTag() {
|
||||||
|
assertEquals(new Locale("invalid"), StringUtils.parseLocale("invalid"));
|
||||||
|
assertEquals(new Locale("invalidvalue"), StringUtils.parseLocale("invalidvalue"));
|
||||||
|
assertEquals(new Locale("invalidvalue", "foo"), StringUtils.parseLocale("invalidvalue_foo"));
|
||||||
|
assertNull(StringUtils.parseLocale(""));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ dependencies {
|
||||||
exclude group: "javax.servlet", module: "javax.servlet-api"
|
exclude group: "javax.servlet", module: "javax.servlet-api"
|
||||||
}
|
}
|
||||||
optional("org.eclipse.jetty:jetty-reactive-httpclient:1.0.2")
|
optional("org.eclipse.jetty:jetty-reactive-httpclient:1.0.2")
|
||||||
optional("com.squareup.okhttp3:okhttp:3.13.1")
|
optional("com.squareup.okhttp3:okhttp:3.14.0")
|
||||||
optional("org.apache.httpcomponents:httpclient:4.5.7") {
|
optional("org.apache.httpcomponents:httpclient:4.5.7") {
|
||||||
exclude group: "commons-logging", module: "commons-logging"
|
exclude group: "commons-logging", module: "commons-logging"
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +75,7 @@ dependencies {
|
||||||
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
||||||
testCompile("org.eclipse.jetty:jetty-server")
|
testCompile("org.eclipse.jetty:jetty-server")
|
||||||
testCompile("org.eclipse.jetty:jetty-servlet")
|
testCompile("org.eclipse.jetty:jetty-servlet")
|
||||||
testCompile("com.squareup.okhttp3:mockwebserver:3.13.1")
|
testCompile("com.squareup.okhttp3:mockwebserver:3.14.0")
|
||||||
testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
|
testCompile("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
|
||||||
testCompile("org.skyscreamer:jsonassert:1.5.0")
|
testCompile("org.skyscreamer:jsonassert:1.5.0")
|
||||||
testCompile("org.xmlunit:xmlunit-matchers:2.6.2")
|
testCompile("org.xmlunit:xmlunit-matchers:2.6.2")
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ dependencies {
|
||||||
testCompile("org.eclipse.jetty:jetty-server")
|
testCompile("org.eclipse.jetty:jetty-server")
|
||||||
testCompile("org.eclipse.jetty:jetty-servlet")
|
testCompile("org.eclipse.jetty:jetty-servlet")
|
||||||
testCompile("org.eclipse.jetty:jetty-reactive-httpclient:1.0.2")
|
testCompile("org.eclipse.jetty:jetty-reactive-httpclient:1.0.2")
|
||||||
testCompile("com.squareup.okhttp3:mockwebserver:3.13.1")
|
testCompile("com.squareup.okhttp3:mockwebserver:3.14.0")
|
||||||
testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
|
testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
|
||||||
testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}")
|
testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}")
|
||||||
testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
|
testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-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.
|
||||||
|
|
@ -446,7 +446,7 @@ public abstract class ResponseEntityExceptionHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A single place to customize the response body of all Exception types.
|
* A single place to customize the response body of all exception types.
|
||||||
* <p>The default implementation sets the {@link WebUtils#ERROR_EXCEPTION_ATTRIBUTE}
|
* <p>The default implementation sets the {@link WebUtils#ERROR_EXCEPTION_ATTRIBUTE}
|
||||||
* request attribute and creates a {@link ResponseEntity} from the given
|
* request attribute and creates a {@link ResponseEntity} from the given
|
||||||
* body, headers, and status.
|
* body, headers, and status.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue