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/14 18:32:27 UTC
ambari git commit: AMBARI-22325. Get rid of unchecked warning in
BlueprintV2Factory (adoroszlai)
Repository: ambari
Updated Branches:
refs/heads/branch-feature-AMBARI-14714-blueprintv2 8a5518740 -> 4065f35e6
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/4065f35e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4065f35e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4065f35e
Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2
Commit: 4065f35e6d09b7e3f8c13f31b67e305ef3664367
Parents: 8a55187
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Tue Nov 14 19:30:58 2017 +0100
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Tue Nov 14 19:30:58 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/4065f35e/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) {