Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
8f9c067a
Commit
8f9c067a
authored
Feb 27, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
257e324b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
RelaxedConversionService.java
...g/springframework/boot/bind/RelaxedConversionService.java
+2
-3
RelaxedConversionServiceTests.java
...ingframework/boot/bind/RelaxedConversionServiceTests.java
+5
-4
No files found.
spring-boot/src/main/java/org/springframework/boot/bind/RelaxedConversionService.java
View file @
8f9c067a
...
...
@@ -127,9 +127,8 @@ class RelaxedConversionService implements ConversionService {
}
source
=
source
.
trim
();
for
(
T
candidate
:
(
Set
<
T
>)
EnumSet
.
allOf
(
this
.
enumType
))
{
RelaxedNames
names
=
new
RelaxedNames
(
candidate
.
name
().
replace
(
'_'
,
'-'
)
.
toLowerCase
(
Locale
.
ENGLISH
));
RelaxedNames
names
=
new
RelaxedNames
(
candidate
.
name
()
.
replace
(
'_'
,
'-'
).
toLowerCase
(
Locale
.
ENGLISH
));
for
(
String
name
:
names
)
{
if
(
name
.
equals
(
source
))
{
return
candidate
;
...
...
spring-boot/src/test/java/org/springframework/boot/bind/RelaxedConversionServiceTests.java
View file @
8f9c067a
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
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.
...
...
@@ -31,13 +31,14 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public
class
RelaxedConversionServiceTests
{
private
RelaxedConversionService
conversionService
=
new
RelaxedConversionService
(
new
DefaultConversionService
());
private
RelaxedConversionService
conversionService
=
new
RelaxedConversionService
(
new
DefaultConversionService
());
@Test
public
void
conversionServiceShouldAlwaysUseLocaleEnglish
()
{
Locale
.
setDefault
(
new
Locale
(
"tr"
));
TestEnum
result
=
this
.
conversionService
.
convert
(
"accept-case-insensitive-properties"
,
TestEnum
.
class
);
TestEnum
result
=
this
.
conversionService
.
convert
(
"accept-case-insensitive-properties"
,
TestEnum
.
class
);
assertThat
(
result
.
equals
(
TestEnum
.
ACCEPT_CASE_INSENSITIVE_PROPERTIES
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment