Revert "+= won't let compile optimize String concats"

This reverts commit 4dc78c10ee.
This commit is contained in:
Trustin Lee 2014-01-19 14:39:29 +09:00
parent 88fba71b4c
commit a0714d1da3

View File

@ -559,17 +559,14 @@ public class HttpPostRequestEncoder implements ChunkedInput<HttpContent> {
.size() - 2); .size() - 2);
// remove past size // remove past size
globalBodySize -= pastAttribute.size(); globalBodySize -= pastAttribute.size();
StringBuilder replacement = new StringBuilder().append(HttpPostBodyUtil.CONTENT_DISPOSITION) String replacement = HttpPostBodyUtil.CONTENT_DISPOSITION + ": " + HttpPostBodyUtil.FORM_DATA
.append(": ").append(HttpPostBodyUtil.FORM_DATA).append("; ").append(HttpPostBodyUtil.NAME) + "; " + HttpPostBodyUtil.NAME + "=\"" + fileUpload.getName() + "\"\r\n";
.append("=\"").append(fileUpload.getName()).append("\"\r\n"); replacement += HttpHeaders.Names.CONTENT_TYPE + ": " + HttpPostBodyUtil.MULTIPART_MIXED + "; "
replacement.append(HttpHeaders.Names.CONTENT_TYPE).append(": ") + HttpHeaders.Values.BOUNDARY + '=' + multipartMixedBoundary + "\r\n\r\n";
.append(HttpPostBodyUtil.MULTIPART_MIXED).append("; ").append(HttpHeaders.Values.BOUNDARY) replacement += "--" + multipartMixedBoundary + "\r\n";
.append('=').append(multipartMixedBoundary).append("\r\n\r\n"); replacement += HttpPostBodyUtil.CONTENT_DISPOSITION + ": " + HttpPostBodyUtil.FILE + "; "
replacement.append("--").append(multipartMixedBoundary).append("\r\n"); + HttpPostBodyUtil.FILENAME + "=\"" + fileUpload.getFilename() + "\"\r\n";
replacement.append(HttpPostBodyUtil.CONTENT_DISPOSITION).append(": ").append(HttpPostBodyUtil.FILE) pastAttribute.setValue(replacement, 1);
.append("; ").append(HttpPostBodyUtil.FILENAME).append("=\"")
.append(fileUpload.getFilename()).append("\"\r\n");
pastAttribute.setValue(replacement.toString(), 1);
// update past size // update past size
globalBodySize += pastAttribute.size(); globalBodySize += pastAttribute.size();