Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Sep 14, 2020
1 parent bb5b12a commit 7056dd5
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 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.
Expand Down Expand Up @@ -30,9 +30,9 @@
*/
final class StringToBooleanConverter implements Converter<String, Boolean> {

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

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

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


@Override
public Boolean convert(String source) {
String value = source.trim();
if ("".equals(value)) {
if (value.isEmpty()) {
return null;
}
value = value.toLowerCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,8 @@ public void setContentDispositionFormData(String name, String filename, Charset
return;
}
Assert.notNull(name, "'name' must not be null");
String encodedFileName = encodeHeaderFieldParam(filename, charset);
set(CONTENT_DISPOSITION, "form-data; name=\"" + name + '\"' + "; filename*=" + encodedFileName);
String encodedFilename = encodeHeaderFieldParam(filename, charset);
set(CONTENT_DISPOSITION, "form-data; name=\"" + name + '\"' + "; filename*=" + encodedFilename);
}

/**
Expand Down
Loading

0 comments on commit 7056dd5

Please sign in to comment.