Skip to content

Commit 7056dd5

Browse files
committed
Polishing
1 parent bb5b12a commit 7056dd5

File tree

5 files changed

+56
-18
lines changed

5 files changed

+56
-18
lines changed

spring-core/src/main/java/org/springframework/core/convert/support/StringToBooleanConverter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,9 +30,9 @@
3030
*/
3131
final class StringToBooleanConverter implements Converter<String, Boolean> {
3232

33-
private static final Set<String> trueValues = new HashSet<String>(4);
33+
private static final Set<String> trueValues = new HashSet<String>(8);
3434

35-
private static final Set<String> falseValues = new HashSet<String>(4);
35+
private static final Set<String> falseValues = new HashSet<String>(8);
3636

3737
static {
3838
trueValues.add("true");
@@ -46,10 +46,11 @@ final class StringToBooleanConverter implements Converter<String, Boolean> {
4646
falseValues.add("0");
4747
}
4848

49+
4950
@Override
5051
public Boolean convert(String source) {
5152
String value = source.trim();
52-
if ("".equals(value)) {
53+
if (value.isEmpty()) {
5354
return null;
5455
}
5556
value = value.toLowerCase();

spring-web/src/main/java/org/springframework/http/HttpHeaders.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,8 @@ public void setContentDispositionFormData(String name, String filename, Charset
715715
return;
716716
}
717717
Assert.notNull(name, "'name' must not be null");
718-
String encodedFileName = encodeHeaderFieldParam(filename, charset);
719-
set(CONTENT_DISPOSITION, "form-data; name=\"" + name + '\"' + "; filename*=" + encodedFileName);
718+
String encodedFilename = encodeHeaderFieldParam(filename, charset);
719+
set(CONTENT_DISPOSITION, "form-data; name=\"" + name + '\"' + "; filename*=" + encodedFilename);
720720
}
721721

722722
/**

0 commit comments

Comments
 (0)