From 3b4448637fbb9d74e0c9d44048ba76bb7c1214ce Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 20 Feb 2017 13:17:27 +0900 Subject: Enable and fix warnings about redundant specification of type arguments Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/lfs/server/s3/S3Repository.java | 10 +++++----- .../src/org/eclipse/jgit/lfs/server/s3/SignerV4.java | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'org.eclipse.jgit.lfs.server/src') diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java index c229758d43..ed896adff2 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/S3Repository.java @@ -94,10 +94,10 @@ public class S3Repository implements LargeFileRepository { @Override public Response.Action getDownloadAction(AnyLongObjectId oid) { URL endpointUrl = getObjectUrl(oid); - Map queryParams = new HashMap(); + Map queryParams = new HashMap<>(); queryParams.put(X_AMZ_EXPIRES, Integer.toString(s3Config.getExpirationSeconds())); - Map headers = new HashMap(); + Map headers = new HashMap<>(); String authorizationQueryParameters = SignerV4.createAuthorizationQuery( s3Config, endpointUrl, METHOD_GET, headers, queryParams, UNSIGNED_PAYLOAD); @@ -111,7 +111,7 @@ public class S3Repository implements LargeFileRepository { public Response.Action getUploadAction(AnyLongObjectId oid, long size) { cacheObjectMetaData(oid, size); URL objectUrl = getObjectUrl(oid); - Map headers = new HashMap(); + Map headers = new HashMap<>(); headers.put(X_AMZ_CONTENT_SHA256, oid.getName()); headers.put(HDR_CONTENT_LENGTH, Long.toString(size)); headers.put(X_AMZ_STORAGE_CLASS, s3Config.getStorageClass()); @@ -134,10 +134,10 @@ public class S3Repository implements LargeFileRepository { @Override public long getSize(AnyLongObjectId oid) throws IOException { URL endpointUrl = getObjectUrl(oid); - Map queryParams = new HashMap(); + Map queryParams = new HashMap<>(); queryParams.put(X_AMZ_EXPIRES, Integer.toString(s3Config.getExpirationSeconds())); - Map headers = new HashMap(); + Map headers = new HashMap<>(); String authorizationQueryParameters = SignerV4.createAuthorizationQuery( s3Config, endpointUrl, METHOD_HEAD, headers, queryParams, diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java index 4149484c8c..a9b0ec46e4 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/s3/SignerV4.java @@ -240,7 +240,7 @@ class SignerV4 { private static String canonicalizeHeaderNames( Map headers) { - List sortedHeaders = new ArrayList(); + List sortedHeaders = new ArrayList<>(); sortedHeaders.addAll(headers.keySet()); Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER); @@ -260,7 +260,7 @@ class SignerV4 { return ""; //$NON-NLS-1$ } - List sortedHeaders = new ArrayList(); + List sortedHeaders = new ArrayList<>(); sortedHeaders.addAll(headers.keySet()); Collections.sort(sortedHeaders, String.CASE_INSENSITIVE_ORDER); @@ -305,7 +305,7 @@ class SignerV4 { return ""; //$NON-NLS-1$ } - SortedMap sorted = new TreeMap(); + SortedMap sorted = new TreeMap<>(); Iterator> pairs = parameters.entrySet() .iterator(); -- cgit v1.2.3