From f47593695b68356803d45475b85a0e12388426cc Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Tue, 17 Oct 2017 15:59:37 +0530 Subject: Replace type in constructor with diamond operator Issue-id:SO-227 Change-Id: Iffd874a5abad36d282f62e4e7cce9a3cd36e3c80 Signed-off-by: rama-huawei --- .../java/com/woorea/openstack/base/client/OpenStackClient.java | 2 +- .../java/com/woorea/openstack/base/client/OpenStackRequest.java | 8 ++++---- .../woorea/openstack/base/client/OpenStackResponseException.java | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'openstack-client/src/main/java') diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java index d1889b9..7d5f14f 100644 --- a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java @@ -100,7 +100,7 @@ public class OpenStackClient { } public OpenStackRequest get(String path, Class returnType) { - return new OpenStackRequest(this, HttpMethod.GET, path, null, returnType); + return new OpenStackRequest<>(this, HttpMethod.GET, path, null, returnType); } } diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java index 7708304..fabd9db 100644 --- a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java @@ -46,7 +46,7 @@ public class OpenStackRequest { private StringBuilder path = new StringBuilder(); - private Map> headers = new HashMap>(); + private Map> headers = new HashMap<>(); private Entity entity; @@ -91,7 +91,7 @@ public class OpenStackRequest { } public Entity entity(T entity, String contentType) { - return new Entity(entity, contentType); + return new Entity<>(entity, contentType); } public Entity entity() { @@ -128,7 +128,7 @@ public class OpenStackRequest { + entity + ", returnType=" + returnType + "]"; } - private Map > queryParams = new LinkedHashMap >(); + private Map > queryParams = new LinkedHashMap<>(); public Map > queryParams() { return queryParams; @@ -139,7 +139,7 @@ public class OpenStackRequest { List values = queryParams.get(key); values.add(value); } else { - List values = new ArrayList(); + List values = new ArrayList<>(); values.add(value); queryParams.put(key, values); } diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java index 8959b41..edc7ec0 100644 --- a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java @@ -43,6 +43,7 @@ public class OpenStackResponseException extends OpenStackBaseException { this.response = response; } + @Override public String getMessage() { return message; } -- cgit 1.2.3-korg