protected Map<String, Object> parseJSON(String json) throws AmbariException {
    if ((json == null) || json.isEmpty()) {
      return Collections.emptyMap();
    } else {
      try {
        return new Gson().fromJson(json,
            new TypeToken<Map<String, Object>>() {
            }.getType());
      } catch (JsonSyntaxException e) {
        throw new AmbariException("Failed to parse JSON-formatted string", e);
      }
    }
  }
Parses a JSON-formatted String into a (generic) Map.

@param json a String containing the JSON-formatted text to parse
@return a Map of the data
@throws AmbariException if an error occurs while parsing the JSON-formatted String
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorFactory.java