Skip to content
Permalink
Browse files
Merge pull request #65 from arturobernalg/feature/FILEUPLOAD-315
FILEUPLOAD-315 - java8 improvement:
  • Loading branch information
jochenw committed Apr 26, 2021
2 parents 5b4060f + f2fa3c4 commit 66427249f9039ed8f65343f94946a3eb6f395cbf
Showing 2 changed files with 2 additions and 11 deletions.
@@ -386,12 +386,7 @@ public Map<String, List<FileItem>> parseParameterMap(final RequestContext ctx)

for (final FileItem fileItem : items) {
final String fieldName = fileItem.getFieldName();
List<FileItem> mappedItems = itemsMap.get(fieldName);

if (mappedItems == null) {
mappedItems = new ArrayList<>();
itemsMap.put(fieldName, mappedItems);
}
List<FileItem> mappedItems = itemsMap.computeIfAbsent(fieldName, k -> new ArrayList<>());

mappedItems.add(fileItem);
}
@@ -87,11 +87,7 @@ public Iterator<String> getHeaders(final String name) {
*/
public synchronized void addHeader(final String name, final String value) {
final String nameLower = name.toLowerCase(Locale.ENGLISH);
List<String> headerValueList = headerNameToValueListMap.get(nameLower);
if (null == headerValueList) {
headerValueList = new ArrayList<>();
headerNameToValueListMap.put(nameLower, headerValueList);
}
List<String> headerValueList = headerNameToValueListMap.computeIfAbsent(nameLower, k -> new ArrayList<>());
headerValueList.add(value);
}

0 comments on commit 6642724

Please sign in to comment.