Use Map.of() for statically defined map

This commit is contained in:
Nicolas Remond 2021-06-15 23:44:37 +02:00 committed by Ehren Kret
parent a96865d0f5
commit 489519a982
1 changed files with 4 additions and 5 deletions

View File

@ -76,11 +76,10 @@ public class AttachmentControllerV3 extends AttachmentControllerBase {
}
private static Map<String, String> getHeaderMap(@Nonnull CanonicalRequest canonicalRequest) {
Map<String, String> result = new HashMap<>(3);
result.put("host", canonicalRequest.getDomain());
result.put("x-goog-content-length-range", "1," + canonicalRequest.getMaxSizeInBytes());
result.put("x-goog-resumable", "start");
return result;
return Map.of(
"host", canonicalRequest.getDomain(),
"x-goog-content-length-range", "1," + canonicalRequest.getMaxSizeInBytes(),
"x-goog-resumable", "start");
}
private String generateAttachmentKey() {