You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2017/11/24 12:40:00 UTC

[18/39] ambari git commit: AMBARI-22325. Get rid of unchecked warning in BlueprintV2Factory (adoroszlai)

AMBARI-22325. Get rid of unchecked warning in BlueprintV2Factory (adoroszlai)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/734f1785
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/734f1785
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/734f1785

Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2
Commit: 734f17851cf80a9465f92defbc4ea83906838ac3
Parents: 23e985f
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Tue Nov 14 19:30:58 2017 +0100
Committer: Doroszlai, Attila <ad...@hortonworks.com>
Committed: Fri Nov 24 13:30:45 2017 +0100

----------------------------------------------------------------------
 .../org/apache/ambari/server/topology/BlueprintV2Factory.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/734f1785/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
index fa12173..2c5bc8b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java
@@ -20,7 +20,6 @@
 package org.apache.ambari.server.topology;
 
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.Optional;
 import java.util.function.Function;
@@ -41,6 +40,7 @@ import org.apache.ambari.server.state.StackId;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.Version;
+import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver;
@@ -119,9 +119,8 @@ public class BlueprintV2Factory {
     return convertFromJson(blueprintEntity.getContent());
   }
 
-  @SuppressWarnings("unchecked")
   public Map<String, Object> convertToMap(BlueprintV2Entity entity) throws IOException {
-    return createObjectMapper().readValue(entity.getContent(), HashMap.class);
+    return createObjectMapper().readValue(entity.getContent(), new TypeReference<Map<String, Object>>(){});
   }
 
   private StackV2 parseStack(StackId stackId) {