From b2d002041040b4e612ef7e9219144a39125b17a5 Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Wed, 18 Oct 2017 11:49:03 +0530 Subject: Replace type specification with operator "<>" Issue-id: SO-224 Change-Id: I83d5904758ef700d0e450571d98f9511dc9eb28a Signed-off-by: rama-huawei --- .../src/main/java/com/woorea/openstack/glance/model/ImageUpload.java | 2 +- heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java | 4 ++-- .../main/java/com/woorea/openstack/connector/RESTEasyConnector.java | 2 ++ .../main/java/com/woorea/openstack/connector/RESTEasyResponse.java | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java index ac10843..f68b2be 100644 --- a/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java +++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java @@ -61,7 +61,7 @@ public class ImageUpload { */ public Map getProperties() { if(properties == null) { - properties = new HashMap(); + properties = new HashMap<>(); } return properties; } diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java index 2fa1535..724f6de 100644 --- a/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java +++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java @@ -225,7 +225,7 @@ public class Stack { { try { String s = mapper.writeValueAsString(_findOutputValue(key)); - return (mapper.readValue(s, type)); + return mapper.readValue(s, type); } catch (IOException e) { return null; @@ -233,7 +233,7 @@ public class Stack { } @JsonProperty("parameters") - private Map parameters = new HashMap(); + private Map parameters = new HashMap<>(); public void setParameters (Map params) { diff --git a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java index 9fd4754..58c11e1 100644 --- a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java +++ b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java @@ -55,6 +55,7 @@ public class RESTEasyConnector implements OpenStackClientConnector { super(); addContextResolver(new ContextResolver() { + @Override public ObjectMapper getContext(Class type) { return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; } @@ -95,6 +96,7 @@ public class RESTEasyConnector implements OpenStackClientConnector { providerFactory = new OpenStackProviderFactory(); } + @Override public OpenStackResponse request(OpenStackRequest request) { ClientRequest client = new ClientRequest(UriBuilder.fromUri(request.endpoint() + "/" + request.path()), ClientRequest.getDefaultExecutor(), providerFactory); diff --git a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java index dc57d88..344317f 100644 --- a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java +++ b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java @@ -62,7 +62,7 @@ public class RESTEasyResponse implements OpenStackResponse { @Override public Map headers() { - Map headers = new HashMap(); + Map headers = new HashMap<>(); MultivaluedMap responseHeaders = response.getHeaders(); for (String key : responseHeaders.keySet()) { -- cgit 1.2.3-korg