ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [32/50] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
Date Wed, 29 Mar 2017 22:40:50 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java
index e0d16af..5b65833 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareDisableKerberosServerAction.java
@@ -91,7 +91,7 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS
           }
         });
 
-    Map<String, Map<String, String>> kerberosConfigurations = new HashMap<String, Map<String, String>>();
+    Map<String, Map<String, String>> kerberosConfigurations = new HashMap<>();
     Map<String, String> commandParameters = getCommandParameters();
     String dataDirectory = getCommandParameterValue(commandParameters, DATA_DIRECTORY);
 
@@ -143,7 +143,7 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS
     // Ensure the cluster-env/security_enabled flag is set properly
     Map<String, String> clusterEnvProperties = kerberosConfigurations.get(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE);
     if (clusterEnvProperties == null) {
-      clusterEnvProperties = new HashMap<String, String>();
+      clusterEnvProperties = new HashMap<>();
       kerberosConfigurations.put(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE, clusterEnvProperties);
     }
     clusterEnvProperties.put(KerberosHelper.SECURITY_ENABLED_PROPERTY_NAME, "false");
@@ -157,13 +157,13 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS
         throw new AmbariException(message);
       }
 
-      Map<String, Set<String>> configurationsToRemove = new HashMap<String, Set<String>>();
+      Map<String, Set<String>> configurationsToRemove = new HashMap<>();
 
       // Fill the configurationsToRemove map with all Kerberos-related configurations.  Values
       // needed to be kept will have new values from the stack definition and thus pruned from
       // this map.
       for (Map.Entry<String, Map<String, String>> entry : kerberosConfigurations.entrySet()) {
-        configurationsToRemove.put(entry.getKey(), new HashSet<String>(entry.getValue().keySet()));
+        configurationsToRemove.put(entry.getKey(), new HashSet<>(entry.getValue().keySet()));
       }
 
       // Remove cluster-env from the set of configurations to remove since it has no default set
@@ -171,7 +171,7 @@ public class PrepareDisableKerberosServerAction extends AbstractPrepareKerberosS
       configurationsToRemove.remove("cluster-env");
 
       if (!schToProcess.isEmpty()) {
-        Set<String> visitedServices = new HashSet<String>();
+        Set<String> visitedServices = new HashSet<>();
 
         for (ServiceComponentHost sch : schToProcess) {
           String serviceName = sch.getServiceName();

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java
index ed01633..ca15695 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareEnableKerberosServerAction.java
@@ -68,7 +68,7 @@ public class PrepareEnableKerberosServerAction extends PrepareKerberosIdentities
 
     Map<String, String> commandParameters = getCommandParameters();
     String dataDirectory = getCommandParameterValue(commandParameters, DATA_DIRECTORY);
-    Map<String, Map<String, String>> kerberosConfigurations = new HashMap<String, Map<String, String>>();
+    Map<String, Map<String, String>> kerberosConfigurations = new HashMap<>();
 
     int schCount = schToProcess.size();
     if (schCount == 0) {
@@ -100,7 +100,7 @@ public class PrepareEnableKerberosServerAction extends PrepareKerberosIdentities
     // Ensure the cluster-env/security_enabled flag is set properly
     Map<String, String> clusterEnvProperties = kerberosConfigurations.get(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE);
     if (clusterEnvProperties == null) {
-      clusterEnvProperties = new HashMap<String, String>();
+      clusterEnvProperties = new HashMap<>();
       kerberosConfigurations.put(KerberosHelper.SECURITY_ENABLED_CONFIG_TYPE, clusterEnvProperties);
     }
     clusterEnvProperties.put(KerberosHelper.SECURITY_ENABLED_PROPERTY_NAME, "true");

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java
index 9935844..f239cff 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/PrepareKerberosIdentitiesServerAction.java
@@ -72,7 +72,7 @@ public class PrepareKerberosIdentitiesServerAction extends AbstractPrepareKerber
 
     Map<String, String> commandParameters = getCommandParameters();
     String dataDirectory = getCommandParameterValue(commandParameters, DATA_DIRECTORY);
-    Map<String, Map<String, String>> kerberosConfigurations = new HashMap<String, Map<String, String>>();
+    Map<String, Map<String, String>> kerberosConfigurations = new HashMap<>();
 
     int schCount = schToProcess.size();
     if (schCount == 0) {
@@ -179,11 +179,11 @@ public class PrepareKerberosIdentitiesServerAction extends AbstractPrepareKerber
     if (!schToProcess.isEmpty()) {
       actionLog.writeStdOut("Creating auth-to-local rules");
 
-      Map<String, Set<String>> services = new HashMap<String, Set<String>>();
+      Map<String, Set<String>> services = new HashMap<>();
       for (ServiceComponentHost sch : schToProcess) {
         Set<String> components = services.get(sch.getServiceName());
         if (components == null) {
-          components = new HashSet<String>();
+          components = new HashSet<>();
           services.put(sch.getServiceName(), components);
         }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerAction.java
index b75100e..f776575 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/UpdateKerberosConfigsServerAction.java
@@ -86,8 +86,8 @@ public class UpdateKerberosConfigsServerAction extends AbstractServerAction {
 
     String authenticatedUserName = getCommandParameterValue(getCommandParameters(), KerberosServerAction.AUTHENTICATED_USER_NAME);
     String dataDirectoryPath = getCommandParameterValue(getCommandParameters(), KerberosServerAction.DATA_DIRECTORY);
-    HashMap<String, Map<String, String>> propertiesToSet = new HashMap<String, Map<String, String>>();
-    HashMap<String, Collection<String>> propertiesToRemove = new HashMap<String, Collection<String>>();
+    HashMap<String, Map<String, String>> propertiesToSet = new HashMap<>();
+    HashMap<String, Collection<String>> propertiesToRemove = new HashMap<>();
 
     // If the data directory path is set, attempt to process further, else assume there is no work to do
     if (dataDirectoryPath != null) {
@@ -96,7 +96,7 @@ public class UpdateKerberosConfigsServerAction extends AbstractServerAction {
       // If the data directory exists, attempt to process further, else assume there is no work to do
       if (dataDirectory.exists()) {
         KerberosConfigDataFileReader configReader = null;
-        Set<String> configTypes = new HashSet<String>();
+        Set<String> configTypes = new HashSet<>();
 
         try {
           // If the config data file exists, iterate over the records to find the (explicit)
@@ -201,7 +201,7 @@ public class UpdateKerberosConfigsServerAction extends AbstractServerAction {
   private void addConfigTypePropVal(HashMap<String, Map<String, String>> configurations, String configType, String prop, String val) {
     Map<String, String> configTypePropsVal = configurations.get(configType);
     if (configTypePropsVal == null) {
-      configTypePropsVal = new HashMap<String, String>();
+      configTypePropsVal = new HashMap<>();
       configurations.put(configType, configTypePropsVal);
     }
     configTypePropsVal.put(prop, val);
@@ -218,7 +218,7 @@ public class UpdateKerberosConfigsServerAction extends AbstractServerAction {
   private void removeConfigTypeProp(HashMap<String, Collection<String>> configurations, String configType, String prop) {
     Collection<String> configTypeProps = configurations.get(configType);
     if (configTypeProps == null) {
-      configTypeProps = new HashSet<String>();
+      configTypeProps = new HashSet<>();
       configurations.put(configType, configTypeProps);
     }
     configTypeProps.add(prop);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
index ed874c1..086055d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
@@ -187,9 +187,9 @@ public class FinalizeUpgradeAction extends AbstractServerAction {
           clusterName, clusterDesiredStackId, version);
 
       // Will include hosts whose state is INSTALLED
-      Set<HostVersionEntity> hostVersionsAllowed = new HashSet<HostVersionEntity>();
-      Set<String> hostsWithoutCorrectVersionState = new HashSet<String>();
-      Set<String> hostsToUpdate = new HashSet<String>();
+      Set<HostVersionEntity> hostVersionsAllowed = new HashSet<>();
+      Set<String> hostsWithoutCorrectVersionState = new HashSet<>();
+      Set<String> hostsToUpdate = new HashSet<>();
 
       // It is important to only iterate over the hosts with a version, as
       // opposed to all hosts, since some hosts may only have components that do
@@ -406,7 +406,7 @@ public class FinalizeUpgradeAction extends AbstractServerAction {
           "for cluster versions that do not match %s\n", version));
       }
 
-      Set<String> badVersions = new HashSet<String>();
+      Set<String> badVersions = new HashSet<>();
 
       // update the cluster version
       for (ClusterVersionEntity cve : clusterVersionDAO.findByCluster(clusterName)) {
@@ -427,7 +427,7 @@ public class FinalizeUpgradeAction extends AbstractServerAction {
       out.append(String.format("Found %d other version(s) not matching downgrade: %s\n",
           badVersions.size(), StringUtils.join(badVersions, ", ")));
 
-      Set<String> badHosts = new HashSet<String>();
+      Set<String> badHosts = new HashSet<>();
       for (String badVersion : badVersions) {
         List<HostVersionEntity> hostVersions = hostVersionDAO.findByClusterStackAndVersion(
             clusterName, targetStackId, badVersion);
@@ -482,7 +482,7 @@ public class FinalizeUpgradeAction extends AbstractServerAction {
   protected List<InfoTuple> checkHostComponentVersions(Cluster cluster, String desiredVersion, StackId targetStackId)
           throws AmbariException {
 
-    ArrayList<InfoTuple> errors = new ArrayList<InfoTuple>();
+    ArrayList<InfoTuple> errors = new ArrayList<>();
 
     for (Service service : cluster.getServices().values()) {
       for (ServiceComponent serviceComponent : service.getServiceComponents().values()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpgradeUserKerberosDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpgradeUserKerberosDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpgradeUserKerberosDescriptor.java
index ac1e86d..59690a3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpgradeUserKerberosDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpgradeUserKerberosDescriptor.java
@@ -105,13 +105,13 @@ public class UpgradeUserKerberosDescriptor extends AbstractServerAction {
     HostRoleCommand hostRoleCommand = getHostRoleCommand();
     String clusterName = hostRoleCommand.getExecutionCommandWrapper().getExecutionCommand().getClusterName();
     Cluster cluster = clusters.getCluster(clusterName);
-    List<String> messages = new ArrayList<String>();
-    List<String> errorMessages = new ArrayList<String>();
+    List<String> messages = new ArrayList<>();
+    List<String> errorMessages = new ArrayList<>();
 
     if (cluster != null) {
       logMessage(messages, "Obtaining the user-defined Kerberos descriptor");
 
-      TreeMap<String, String> foreignKeys = new TreeMap<String, String>();
+      TreeMap<String, String> foreignKeys = new TreeMap<>();
       foreignKeys.put("cluster", String.valueOf(cluster.getClusterId()));
 
       ArtifactEntity entity = artifactDAO.findByNameAndForeignKeys("kerberos_descriptor", foreignKeys);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
index fc49539..cf96703 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/BaseModule.java
@@ -62,8 +62,8 @@ public abstract class BaseModule<T, I> implements StackDefinitionModule<T, I> {
   protected <T extends StackDefinitionModule<T, ?>> Collection<T> mergeChildModules(
       Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions, Map<String, T> modules, Map<String, T> parentModules)
         throws AmbariException {
-    Set<String> addedModules = new HashSet<String>();
-    Collection<T> mergedModules = new HashSet<T>();
+    Set<String> addedModules = new HashSet<>();
+    Collection<T> mergedModules = new HashSet<>();
 
     for (T module : modules.values()) {
       String id = module.getId();

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java
index 41b06e1..ca5a2ae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java
@@ -46,7 +46,7 @@ public class ComponentModule extends BaseModule<ComponentModule, ComponentInfo>
    */
   protected boolean valid = true;
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
 
   /**
    * Constructor.
@@ -158,7 +158,7 @@ public class ComponentModule extends BaseModule<ComponentModule, ComponentInfo>
   private void mergeComponentDependencies(List<DependencyInfo> parentDependencies,
                                           List<DependencyInfo> childDependencies) {
 
-    Collection<String> existingNames = new HashSet<String>();
+    Collection<String> existingNames = new HashSet<>();
 
     for (DependencyInfo childDependency : childDependencies) {
       existingNames.add(childDependency.getName());
@@ -184,7 +184,7 @@ public class ComponentModule extends BaseModule<ComponentModule, ComponentInfo>
   private void mergeCustomCommands(List<CustomCommandDefinition> parentCommands,
                                    List<CustomCommandDefinition> childCommands) {
 
-    Collection<String> existingNames = new HashSet<String>();
+    Collection<String> existingNames = new HashSet<>();
 
     for (CustomCommandDefinition childCmd : childCommands) {
       existingNames.add(childCmd.getName());
@@ -207,7 +207,7 @@ public class ComponentModule extends BaseModule<ComponentModule, ComponentInfo>
    */
   //todo: currently there is no way to remove an inherited log
   private void mergeLogs(List<LogDefinition> parentLogs, List<LogDefinition> childLogs) {
-    Collection<String> existingLogIds = new HashSet<String>();
+    Collection<String> existingLogIds = new HashSet<>();
 
     for (LogDefinition childLog : childLogs) {
       existingLogIds.add(childLog.getLogId());

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationDirectory.java
index a30da6b..b4b8792 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationDirectory.java
@@ -55,7 +55,7 @@ public class ConfigurationDirectory extends StackDefinitionDirectory {
    * Map of configuration type to configuration module.
    * One entry for each configuration file in this configuration directory.
    */
-  private Map<String, ConfigurationModule> configurationModules = new HashMap<String, ConfigurationModule>();
+  private Map<String, ConfigurationModule> configurationModules = new HashMap<>();
 
   /**
    * Logger instance
@@ -137,7 +137,7 @@ public class ConfigurationDirectory extends StackDefinitionDirectory {
    * @return  collection of properties
    */
   private Collection<PropertyInfo> parseProperties(ConfigurationXml configuration, String fileName) {
-  List<PropertyInfo> props = new ArrayList<PropertyInfo>();
+  List<PropertyInfo> props = new ArrayList<>();
   for (PropertyInfo pi : configuration.getProperties()) {
     pi.setFilename(fileName);
     if(pi.getPropertyTypes().contains(PropertyInfo.PropertyType.VALUE_FROM_PROPERTY_FILE)) {
@@ -194,7 +194,7 @@ public class ConfigurationDirectory extends StackDefinitionDirectory {
    * @return  collection of attributes for the configuration type
    */
   private Map<String, String> parseAttributes(ConfigurationXml configuration) {
-    Map<String, String> attributes = new HashMap<String, String>();
+    Map<String, String> attributes = new HashMap<>();
     for (Map.Entry<QName, String> attribute : configuration.getAttributes().entrySet()) {
       attributes.put(attribute.getKey().getLocalPart(), attribute.getValue());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationInfo.java
index dcb1c99..f8a19ac 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationInfo.java
@@ -102,8 +102,8 @@ public class ConfigurationInfo implements Validable{
    * @param specifiedAttributes attributes that have been specified in configuration
    */
   private void setAttributes(Map<String, String> specifiedAttributes) {
-    Map<String, Map<String, String>> attributes = new HashMap<String, Map<String, String>>();
-    Map<String, String> supportsAttributes = new HashMap<String, String>();
+    Map<String, Map<String, String>> attributes = new HashMap<>();
+    Map<String, String> supportsAttributes = new HashMap<>();
     attributes.put(Supports.KEYWORD, supportsAttributes);
 
     for (Map.Entry<String, String> entry : specifiedAttributes.entrySet()) {
@@ -129,7 +129,7 @@ public class ConfigurationInfo implements Validable{
     this.valid = valid;
   }
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
   
   @Override
   public void addError(String error) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationModule.java
index 3cc419c..75652ea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ConfigurationModule.java
@@ -55,7 +55,7 @@ public class ConfigurationModule extends BaseModule<ConfigurationModule, Configu
    */
   protected boolean valid = true;
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
   
   @Override
   public void addError(String error) {
@@ -146,7 +146,7 @@ public class ConfigurationModule extends BaseModule<ConfigurationModule, Configu
    * @param parent  parent configuration module
    */
   private void mergeProperties(ConfigurationModule parent) {
-    Collection<String> existingProps = new HashSet<String>();
+    Collection<String> existingProps = new HashSet<>();
     Iterator<PropertyInfo> iter = info.getProperties().iterator();
     while (iter.hasNext()) {
       PropertyInfo prop = iter.next();
@@ -176,7 +176,7 @@ public class ConfigurationModule extends BaseModule<ConfigurationModule, Configu
       String category = parentCategoryEntry.getKey();
       Map<String, String> categoryAttributeMap = info.getAttributes().get(category);
       if (categoryAttributeMap == null) {
-        categoryAttributeMap = new HashMap<String, String>();
+        categoryAttributeMap = new HashMap<>();
         info.getAttributes().put(category, categoryAttributeMap);
       }
       for (Map.Entry<String, String> parentAttributeEntry : parentCategoryEntry.getValue().entrySet()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
index 7b31925..b72e58c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionDirectory.java
@@ -153,7 +153,7 @@ public class ExtensionDirectory extends StackDefinitionDirectory {
    * @throws AmbariException  if unable to parse the service directories
    */
   private void parseServiceDirectories(Collection<String> subDirs) throws AmbariException {
-    Collection<ServiceDirectory> dirs = new HashSet<ServiceDirectory>();
+    Collection<ServiceDirectory> dirs = new HashSet<>();
 
     if (subDirs.contains(ServiceDirectory.SERVICES_FOLDER_NAME)) {
       String servicesDir = getAbsolutePath() + File.separator + ServiceDirectory.SERVICES_FOLDER_NAME;

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
index e1fdb6a..ce92ecf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java
@@ -78,12 +78,12 @@ public class ExtensionModule extends BaseModule<ExtensionModule, ExtensionInfo>
   /**
    * Map of child configuration modules keyed by configuration type
    */
-  private Map<String, ConfigurationModule> configurationModules = new HashMap<String, ConfigurationModule>();
+  private Map<String, ConfigurationModule> configurationModules = new HashMap<>();
 
   /**
    * Map of child service modules keyed by service name
    */
-  private Map<String, ServiceModule> serviceModules = new HashMap<String, ServiceModule>();
+  private Map<String, ServiceModule> serviceModules = new HashMap<>();
 
   /**
    * Corresponding ExtensionInfo instance
@@ -431,7 +431,7 @@ public class ExtensionModule extends BaseModule<ExtensionModule, ExtensionInfo>
    * @param serviceDirectory the child service directory
    */
   private void populateService(ServiceDirectory serviceDirectory)  {
-    Collection<ServiceModule> serviceModules = new ArrayList<ServiceModule>();
+    Collection<ServiceModule> serviceModules = new ArrayList<>();
     // unfortunately, we allow multiple services to be specified in the same metainfo.xml,
     // so we can't move the unmarshal logic into ServiceModule
     ServiceMetainfoXml metaInfoXml = serviceDirectory.getMetaInfoFile();
@@ -517,7 +517,7 @@ public class ExtensionModule extends BaseModule<ExtensionModule, ExtensionInfo>
     this.valid = valid;
   }
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
 
   @Override
   public Collection<String> getErrors() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java
index 9c953f2..aa51bab 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/HostsType.java
@@ -47,7 +47,7 @@ public class HostsType {
    * That is to say, a downgrade only occurs where the current version is not
    * the target version.
    */
-  public LinkedHashSet<String> hosts = new LinkedHashSet<String>();
+  public LinkedHashSet<String> hosts = new LinkedHashSet<>();
 
   /**
    * Unhealthy hosts are those which are explicitely put into maintenance mode.
@@ -56,6 +56,6 @@ public class HostsType {
    * the administrator know that it must be put into maintenance mode before an
    * upgrade can begin.
    */
-  public List<ServiceComponentHost> unhealthy = new ArrayList<ServiceComponentHost>();
+  public List<ServiceComponentHost> unhealthy = new ArrayList<>();
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
index f5eb007..ce10568 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/MasterHostResolver.java
@@ -203,8 +203,8 @@ public class MasterHostResolver {
       ServiceComponent sc = svc.getServiceComponent(component);
 
       // !!! not really a fan of passing these around
-      List<ServiceComponentHost> unhealthyHosts = new ArrayList<ServiceComponentHost>();
-      LinkedHashSet<String> upgradeHosts = new LinkedHashSet<String>();
+      List<ServiceComponentHost> unhealthyHosts = new ArrayList<>();
+      LinkedHashSet<String> upgradeHosts = new LinkedHashSet<>();
 
       for (String hostName : hostsType.hosts) {
         ServiceComponentHost sch = sc.getServiceComponentHost(hostName);
@@ -264,7 +264,7 @@ public class MasterHostResolver {
    * The hostnames are returned in lowercase.
    */
   private Map<Status, String> getNameNodePair() {
-    Map<Status, String> stateToHost = new HashMap<Status, String>();
+    Map<Status, String> stateToHost = new HashMap<>();
     Cluster cluster = getCluster();
 
     String nameService = m_configHelper.getValueFromDesiredConfigurations(cluster, ConfigHelper.HDFS_SITE, "dfs.internal.nameservices");
@@ -323,7 +323,7 @@ public class MasterHostResolver {
    * @throws MalformedURLException
    */
   private void resolveResourceManagers(Cluster cluster, HostsType hostType) throws MalformedURLException {
-    LinkedHashSet<String> orderedHosts = new LinkedHashSet<String>(hostType.hosts);
+    LinkedHashSet<String> orderedHosts = new LinkedHashSet<>(hostType.hosts);
 
     // IMPORTANT, for RM, only the master returns jmx
     String rmWebAppAddress = m_configHelper.getValueFromDesiredConfigurations(cluster, ConfigHelper.YARN_SITE, "yarn.resourcemanager.webapp.address");

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/QuickLinksConfigurationModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/QuickLinksConfigurationModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/QuickLinksConfigurationModule.java
index 818026b..c879c02 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/QuickLinksConfigurationModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/QuickLinksConfigurationModule.java
@@ -43,7 +43,7 @@ public class QuickLinksConfigurationModule extends BaseModule<QuickLinksConfigur
 
   private QuickLinksConfigurationInfo moduleInfo;
   private boolean valid = true;
-  private Set<String> errors = new HashSet<String>();
+  private Set<String> errors = new HashSet<>();
 
   public QuickLinksConfigurationModule(File quickLinksConfigurationFile) {
     this(quickLinksConfigurationFile, new QuickLinksConfigurationInfo());
@@ -61,7 +61,7 @@ public class QuickLinksConfigurationModule extends BaseModule<QuickLinksConfigur
       }
       try {
         QuickLinks quickLinksConfig = mapper.readValue(reader, QuickLinks.class);
-        Map<String, QuickLinks> map = new HashMap<String, QuickLinks>();
+        Map<String, QuickLinks> map = new HashMap<>();
         map.put(QUICKLINKS_CONFIGURATION_KEY, quickLinksConfig);
         moduleInfo.setQuickLinksConfigurationMap(map);
         LOG.debug("Loaded quicklinks configuration: {}", moduleInfo);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
index 00dc046..1b90f69 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceDirectory.java
@@ -40,7 +40,7 @@ public abstract class ServiceDirectory extends StackDefinitionDirectory {
   /**
    * metrics file
    */
-  private Map<String, File> metricsFileMap = new HashMap<String, File>();
+  private Map<String, File> metricsFileMap = new HashMap<>();
 
   /**
    * advisor file
@@ -75,7 +75,7 @@ public abstract class ServiceDirectory extends StackDefinitionDirectory {
   /**
    * widgets descriptor file
    */
-  private Map<String, File> widgetsDescriptorFileMap = new HashMap<String, File>();
+  private Map<String, File> widgetsDescriptorFileMap = new HashMap<>();
 
   /**
    * package directory path

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
index fdcbacf..1b89192 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java
@@ -71,23 +71,23 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
    * Map of child configuration modules keyed by configuration type
    */
   private Map<String, ConfigurationModule> configurationModules =
-      new HashMap<String, ConfigurationModule>();
+    new HashMap<>();
 
   /**
    * Map of child component modules keyed by component name
    */
   private Map<String, ComponentModule> componentModules =
-      new HashMap<String, ComponentModule>();
+    new HashMap<>();
 
   /**
    * Map of themes, single value currently
    */
-  private Map<String, ThemeModule> themeModules = new HashMap<String, ThemeModule>();
+  private Map<String, ThemeModule> themeModules = new HashMap<>();
 
   /**
    * Map of quicklinks, single value currently
    */
-  private Map<String, QuickLinksConfigurationModule> quickLinksConfigurationModules = new HashMap<String, QuickLinksConfigurationModule>();
+  private Map<String, QuickLinksConfigurationModule> quickLinksConfigurationModules = new HashMap<>();
 
   /**
    * Encapsulates IO operations on service directory
@@ -430,7 +430,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
     String themesDir = serviceDirectory.getAbsolutePath() + File.separator + serviceInfo.getThemesDir();
 
     if (serviceInfo.getThemes() != null) {
-      List<ThemeInfo> themes = new ArrayList<ThemeInfo>(serviceInfo.getThemes().size());
+      List<ThemeInfo> themes = new ArrayList<>(serviceInfo.getThemes().size());
       for (ThemeInfo themeInfo : serviceInfo.getThemes()) {
         File themeFile = new File(themesDir + File.separator + themeInfo.getFileName());
         ThemeModule module = new ThemeModule(themeFile, themeInfo);
@@ -602,7 +602,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
   private void mergeCustomCommands(Collection<CustomCommandDefinition> parentCmds,
                                    Collection<CustomCommandDefinition> childCmds) {
 
-    Collection<String> existingNames = new HashSet<String>();
+    Collection<String> existingNames = new HashSet<>();
 
     for (CustomCommandDefinition childCmd : childCmds) {
       existingNames.add(childCmd.getName());
@@ -636,7 +636,7 @@ public class ServiceModule extends BaseModule<ServiceModule, ServiceInfo> implem
     this.valid = valid;
   }
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
 
   @Override
   public void addError(String error) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
index 8e2e1e1..f68570b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
@@ -143,12 +143,12 @@ public class StackContext {
     /**
      * Registered tasks
      */
-    private Collection<LatestRepoCallable> tasks = new ArrayList<LatestRepoCallable>();
+    private Collection<LatestRepoCallable> tasks = new ArrayList<>();
 
     /**
      * Task futures
      */
-    Collection<Future<Void>> futures = new ArrayList<Future<Void>>();
+    Collection<Future<Void>> futures = new ArrayList<>();
     /**
      * Underlying executor
      */

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
index 3f7249f..d0950a7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackDirectory.java
@@ -364,7 +364,7 @@ public class StackDirectory extends StackDefinitionDirectory {
    * @throws AmbariException  if unable to parse the service directories
    */
   private void parseServiceDirectories(Collection<String> subDirs) throws AmbariException {
-    Collection<ServiceDirectory> dirs = new HashSet<ServiceDirectory>();
+    Collection<ServiceDirectory> dirs = new HashSet<>();
 
     if (subDirs.contains(ServiceDirectory.SERVICES_FOLDER_NAME)) {
       String servicesDir = getAbsolutePath() + File.separator + ServiceDirectory.SERVICES_FOLDER_NAME;
@@ -484,7 +484,7 @@ public class StackDirectory extends StackDefinitionDirectory {
         LOG.info("Role command order info was loaded from file: {}", file.getAbsolutePath());
       } else {
         LOG.info("Stack '{}' doesn't contain role command order file", getPath());
-        result = new HashMap<String, Object>();
+        result = new HashMap<>();
       }
       roleCommandOrder = new StackRoleCommandOrder(result);
       if (LOG.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
index d9a3ac4..20e28fc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackManager.java
@@ -99,7 +99,7 @@ public class StackManager {
   /**
    * Map of stack id to stack info
    */
-  protected Map<String, StackInfo> stackMap = new HashMap<String, StackInfo>();
+  protected Map<String, StackInfo> stackMap = new HashMap<>();
   protected Map<String, ServiceModule> commonServiceModules;
   protected Map<String, StackModule> stackModules;
   protected Map<String, ExtensionModule> extensionModules;
@@ -107,7 +107,7 @@ public class StackManager {
   /**
    * Map of extension id to extension info
    */
-  private Map<String, ExtensionInfo> extensionMap = new HashMap<String, ExtensionInfo>();
+  private Map<String, ExtensionInfo> extensionMap = new HashMap<>();
 
   /**
    * Constructor. Initialize stack manager.
@@ -151,9 +151,9 @@ public class StackManager {
       validateExtensionDirectory(extensionRoot);
     }
 
-    stackMap = new HashMap<String, StackInfo>();
+    stackMap = new HashMap<>();
     stackContext = new StackContext(metaInfoDAO, actionMetadata, osFamily);
-    extensionMap = new HashMap<String, ExtensionInfo>();
+    extensionMap = new HashMap<>();
 
     parseDirectories(stackRoot, commonServicesRoot, extensionRoot);
 
@@ -248,7 +248,7 @@ public class StackManager {
    *         If no stacks match the specified name, an empty collection is returned.
    */
   public Collection<StackInfo> getStacks(String name) {
-    Collection<StackInfo> stacks = new HashSet<StackInfo>();
+    Collection<StackInfo> stacks = new HashSet<>();
     for (StackInfo stack: stackMap.values()) {
       if (stack.getName().equals(name)) {
         stacks.add(stack);
@@ -286,7 +286,7 @@ public class StackManager {
    *         If no extensions match the specified name, an empty collection is returned.
    */
   public Collection<ExtensionInfo> getExtensions(String name) {
-    Collection<ExtensionInfo> extensions = new HashSet<ExtensionInfo>();
+    Collection<ExtensionInfo> extensions = new HashSet<>();
     for (ExtensionInfo extension: extensionMap.values()) {
       if (extension.getName().equals(name)) {
 	  extensions.add(extension);
@@ -495,7 +495,7 @@ public class StackManager {
    * @throws AmbariException if unable to parse all common services
    */
   private Map<String, ServiceModule> parseCommonServicesDirectory(File commonServicesRoot) throws AmbariException {
-    Map<String, ServiceModule> commonServiceModules = new HashMap<String, ServiceModule>();
+    Map<String, ServiceModule> commonServiceModules = new HashMap<>();
 
     if(commonServicesRoot != null) {
       File[] commonServiceFiles = commonServicesRoot.listFiles(AmbariMetaInfo.FILENAME_FILTER);
@@ -538,7 +538,7 @@ public class StackManager {
    * @throws AmbariException if unable to parse all stacks
    */
   private Map<String, StackModule> parseStackDirectory(File stackRoot) throws AmbariException {
-    Map<String, StackModule> stackModules = new HashMap<String, StackModule>();
+    Map<String, StackModule> stackModules = new HashMap<>();
 
     File[] stackFiles = stackRoot.listFiles(AmbariMetaInfo.FILENAME_FILTER);
     for (File stack : stackFiles) {
@@ -580,7 +580,7 @@ public class StackManager {
    * @throws AmbariException if unable to parse all extensions
    */
   private Map<String, ExtensionModule> parseExtensionDirectory(File extensionRoot) throws AmbariException {
-    Map<String, ExtensionModule> extensionModules = new HashMap<String, ExtensionModule>();
+    Map<String, ExtensionModule> extensionModules = new HashMap<>();
     if (extensionRoot == null || !extensionRoot.exists())
       return extensionModules;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
index 24ba686..79e142a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
@@ -104,17 +104,17 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
   /**
    * Map of child configuration modules keyed by configuration type
    */
-  private Map<String, ConfigurationModule> configurationModules = new HashMap<String, ConfigurationModule>();
+  private Map<String, ConfigurationModule> configurationModules = new HashMap<>();
 
   /**
    * Map of child service modules keyed by service name
    */
-  private Map<String, ServiceModule> serviceModules = new HashMap<String, ServiceModule>();
+  private Map<String, ServiceModule> serviceModules = new HashMap<>();
 
   /**
    * Map of linked extension modules keyed by extension name + version
    */
-  private Map<String, ExtensionModule> extensionModules = new HashMap<String, ExtensionModule>();
+  private Map<String, ExtensionModule> extensionModules = new HashMap<>();
 
   /**
    * Corresponding StackInfo instance
@@ -320,7 +320,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     Collection<ServiceModule> mergedModules = mergeChildModules(
         allStacks, commonServices, extensions, serviceModules, parentStack.serviceModules);
 
-    List<String> removedServices = new ArrayList<String>();
+    List<String> removedServices = new ArrayList<>();
 
     for (ServiceModule module : mergedModules) {
       if (module.isDeleted()){
@@ -615,7 +615,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
    * @param serviceDirectory the child service directory
    */
   private void populateService(ServiceDirectory serviceDirectory)  {
-    Collection<ServiceModule> serviceModules = new ArrayList<ServiceModule>();
+    Collection<ServiceModule> serviceModules = new ArrayList<>();
     // unfortunately, we allow multiple services to be specified in the same metainfo.xml,
     // so we can't move the unmarshal logic into ServiceModule
     ServiceMetainfoXml metaInfoXml = serviceDirectory.getMetaInfoFile();
@@ -767,7 +767,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     // Stack-definition has 'depends-on' relationship specified.
     // We have a map to construct the 'depended-by' relationship.
     Map<PropertyDependencyInfo, Set<PropertyDependencyInfo>> dependedByMap =
-      new HashMap<PropertyDependencyInfo, Set<PropertyDependencyInfo>>();
+      new HashMap<>();
 
     // Go through all service-configs and gather the reversed 'depended-by'
     // relationship into map. Since we do not have the reverse {@link PropertyInfo},
@@ -783,7 +783,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
             dependedByMap.get(pdi).add(propertyDependency);
           } else {
             Set<PropertyDependencyInfo> newDependenciesSet =
-              new HashSet<PropertyDependencyInfo>();
+              new HashSet<>();
             newDependenciesSet.add(propertyDependency);
             dependedByMap.put(pdi, newDependenciesSet);
           }
@@ -981,7 +981,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
           if (skippedGroups.containsKey(group.addAfterGroup)) {
             tmp = skippedGroups.get(group.addAfterGroup);
           } else {
-            tmp = new ArrayList<Grouping>();
+            tmp = new ArrayList<>();
             skippedGroups.put(group.addAfterGroup, tmp);
           }
           tmp.add(group);
@@ -1332,7 +1332,7 @@ public class StackModule extends BaseModule<StackModule, StackInfo> implements V
     this.valid = valid;
   }
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
 
   @Override
   public void addError(String error) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stack/ThemeModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ThemeModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ThemeModule.java
index 932d929..72d3bd3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ThemeModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ThemeModule.java
@@ -43,7 +43,7 @@ public class ThemeModule extends BaseModule<ThemeModule, ThemeInfo> implements V
 
   private ThemeInfo moduleInfo;
   private boolean valid = true;
-  private Set<String> errors = new HashSet<String>();
+  private Set<String> errors = new HashSet<>();
 
   public ThemeModule(File themeFile) {
     this(themeFile, new ThemeInfo());
@@ -61,7 +61,7 @@ public class ThemeModule extends BaseModule<ThemeModule, ThemeInfo> implements V
       }
       try {
         Theme theme = mapper.readValue(reader, Theme.class);
-        Map<String, Theme> map = new HashMap<String, Theme>();
+        Map<String, Theme> map = new HashMap<>();
         map.put(THEME_KEY, theme);
         moduleInfo.setThemeMap(map);
         LOG.debug("Loaded theme: {}", moduleInfo);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
index 65a86c0..b54c7c7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
@@ -110,7 +110,7 @@ public class RoleGraph {
    *          {@link RoleCommand}.
    */
   private void build(Map<String, Map<String, HostRoleCommand>> hostRoleCommands) {
-    graph = new TreeMap<String, RoleGraphNode>();
+    graph = new TreeMap<>();
 
     for (String host : hostRoleCommands.keySet()) {
       for (String role : hostRoleCommands.get(host).keySet()) {
@@ -167,8 +167,8 @@ public class RoleGraph {
    */
   public List<Stage> getStages() {
     long initialStageId = initialStage.getStageId();
-    List<Stage> stageList = new ArrayList<Stage>();
-    List<RoleGraphNode> firstStageNodes = new ArrayList<RoleGraphNode>();
+    List<Stage> stageList = new ArrayList<>();
+    List<RoleGraphNode> firstStageNodes = new ArrayList<>();
     while (!graph.isEmpty()) {
       if (LOG.isDebugEnabled()) {
         LOG.debug(stringifyGraph());
@@ -226,7 +226,7 @@ public class RoleGraph {
     // represents an ordered list of stages
     List<Map<String, List<HostRoleCommand>>> orderedCommands = new ArrayList<>();
 
-    List<RoleGraphNode> firstStageNodes = new ArrayList<RoleGraphNode>();
+    List<RoleGraphNode> firstStageNodes = new ArrayList<>();
     while (!graph.isEmpty()) {
       for (String role : graph.keySet()) {
         RoleGraphNode rgn = graph.get(role);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraphNode.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraphNode.java b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraphNode.java
index 3c733a2..d2aac3c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraphNode.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraphNode.java
@@ -34,8 +34,8 @@ public class RoleGraphNode {
   private Role role;
   private RoleCommand command;
   private int inDegree = 0;
-  private List<String> hosts = new ArrayList<String>();
-  private Map<String, RoleGraphNode> edges = new TreeMap<String, RoleGraphNode>();
+  private List<String> hosts = new ArrayList<>();
+  private Map<String, RoleGraphNode> edges = new TreeMap<>();
   public synchronized void addHost(String host) {
     hosts.add(host);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
index 9192285..5ea039c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
@@ -89,7 +89,7 @@ public class CheckHelper {
       List<AbstractCheckDescriptor> checksRegistry) {
 
     final String clusterName = request.getClusterName();
-    final List<PrerequisiteCheck> prerequisiteCheckResults = new ArrayList<PrerequisiteCheck>();
+    final List<PrerequisiteCheck> prerequisiteCheckResults = new ArrayList<>();
 
     List<DescriptorPreCheck> applicablePreChecks = getApplicablePrerequisiteChecks(request, checksRegistry);
     for (DescriptorPreCheck descriptorPreCheck : applicablePreChecks) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
index e038caa..a8a9a0f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
@@ -111,7 +111,7 @@ public class ComponentInfo {
    */
   @XmlElementWrapper(name="dependencies")
   @XmlElements(@XmlElement(name="dependency"))
-  private List<DependencyInfo> dependencies = new ArrayList<DependencyInfo>();
+  private List<DependencyInfo> dependencies = new ArrayList<>();
 
   @XmlElementWrapper(name="configuration-dependencies")
   @XmlElements(@XmlElement(name="config-type"))
@@ -222,7 +222,7 @@ public class ComponentInfo {
 
   public List<LogDefinition> getLogs() {
     if (logs == null) {
-      logs = new ArrayList<LogDefinition>();
+      logs = new ArrayList<>();
     }
     
     return logs;
@@ -252,7 +252,7 @@ public class ComponentInfo {
 
   public List<CustomCommandDefinition> getCustomCommands() {
     if (customCommands == null) {
-      customCommands = new ArrayList<CustomCommandDefinition>();
+      customCommands = new ArrayList<>();
     }
     return customCommands;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 19762a6..05b50ab 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -655,7 +655,7 @@ public class ConfigHelper {
     }
 
     for (Service service : cluster.getServices().values()) {
-      Set<PropertyInfo> serviceProperties = new HashSet<PropertyInfo>(servicesMap.get(service.getName()).getProperties());
+      Set<PropertyInfo> serviceProperties = new HashSet<>(servicesMap.get(service.getName()).getProperties());
       for (PropertyInfo serviceProperty : serviceProperties) {
         if (serviceProperty.getPropertyTypes().contains(propertyType)) {
           String stackPropertyConfigType = fileNameToConfigType(serviceProperty.getFilename());

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
index 0a861d8..543dadd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigImpl.java
@@ -278,7 +278,7 @@ public class ConfigImpl implements Config {
   @Override
   public Map<String, Map<String, String>> getPropertiesAttributes() {
     return null == propertiesAttributes ? null
-        : new HashMap<String, Map<String, String>>(propertiesAttributes);
+        : new HashMap<>(propertiesAttributes);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
index 9d366ae..144b38f1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigMergeHelper.java
@@ -80,7 +80,7 @@ public class ConfigMergeHelper {
 
     // Final result after merging.
     Map<String, Map<String, ThreeWayValue>> result =
-        new HashMap<String, Map<String, ThreeWayValue>>();
+      new HashMap<>();
 
     // For every property of every config type, see if it is going to be merged:
     for (Entry<String, Map<String, String>> entry : oldMap.entrySet()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java
index 8703661..fb8363c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/DependencyInfo.java
@@ -64,7 +64,7 @@ public class DependencyInfo {
   /**
    * Conditions for Component dependency to other components.
    */
-  private List<DependencyConditionInfo> dependencyConditions = new ArrayList<DependencyConditionInfo>();
+  private List<DependencyConditionInfo> dependencyConditions = new ArrayList<>();
   /**
    * Setter for name property.
    *

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/DesiredConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/DesiredConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/state/DesiredConfig.java
index f133078..4fad21d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/DesiredConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/DesiredConfig.java
@@ -35,7 +35,7 @@ public class DesiredConfig {
   private String tag;
   private String serviceName;
   private Long version;
-  private List<HostOverride> hostOverrides = new ArrayList<HostOverride>();
+  private List<HostOverride> hostOverrides = new ArrayList<>();
 
   /**
    * Sets the tag

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ExtensionInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ExtensionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ExtensionInfo.java
index 13cfe92..656a8ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ExtensionInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ExtensionInfo.java
@@ -63,7 +63,7 @@ public class ExtensionInfo implements Comparable<ExtensionInfo>, Validable{
     this.valid = valid;
   }
 
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
 
   @Override
   public void addError(String error) {
@@ -103,7 +103,7 @@ public class ExtensionInfo implements Comparable<ExtensionInfo>, Validable{
   }
 
   public synchronized Collection<ServiceInfo> getServices() {
-    if (services == null) services = new ArrayList<ServiceInfo>();
+    if (services == null) services = new ArrayList<>();
     return services;
   }
 
@@ -160,7 +160,7 @@ public class ExtensionInfo implements Comparable<ExtensionInfo>, Validable{
     // The collection of service descriptor files. A Set is being used because some Kerberos descriptor
     // files contain multiple services, therefore the same File may be encountered more than once.
     // For example the YARN directory may contain YARN and MAPREDUCE2 services.
-    Collection<File> serviceDescriptorFiles = new HashSet<File>();
+    Collection<File> serviceDescriptorFiles = new HashSet<>();
     if (serviceInfos != null) {
       for (ServiceInfo serviceInfo : serviceInfos) {
         File file = serviceInfo.getKerberosDescriptorFile();

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/HostConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/HostConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/state/HostConfig.java
index 3e767e1..f95d843 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/HostConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/HostConfig.java
@@ -31,7 +31,7 @@ import com.google.common.base.Objects;
  */
 
 public class HostConfig {
-  private final Map<Long, String> configGroupOverrides = new ConcurrentHashMap<Long, String>();
+  private final Map<Long, String> configGroupOverrides = new ConcurrentHashMap<>();
   private String defaultVersionTag;
 
   public HostConfig() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java
index 600c31f..5578c09 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java
@@ -61,10 +61,10 @@ public class PropertyInfo {
 
   @XmlElement(name = "property-type")
   @XmlList
-  private Set<PropertyType> propertyTypes = new HashSet<PropertyType>();
+  private Set<PropertyType> propertyTypes = new HashSet<>();
 
   @XmlAnyElement
-  private List<Element> propertyAttributes = new ArrayList<Element>();
+  private List<Element> propertyAttributes = new ArrayList<>();
 
   @XmlElement(name = "value-attributes")
   private ValueAttributesInfo propertyValueAttributes =
@@ -73,11 +73,11 @@ public class PropertyInfo {
   @XmlElementWrapper(name="depends-on")
   @XmlElement(name = "property")
   private Set<PropertyDependencyInfo> dependsOnProperties =
-    new HashSet<PropertyDependencyInfo>();
+    new HashSet<>();
 
   @XmlElementWrapper(name="property_depended_by")
   private Set<PropertyDependencyInfo> dependedByProperties =
-    new HashSet<PropertyDependencyInfo>();
+    new HashSet<>();
 
   /**
    * The list of properties that use this property.
@@ -178,7 +178,7 @@ public class PropertyInfo {
   }
 
   public Map<String, String> getAttributesMap() {
-    Map<String, String> attributes = new HashMap<String, String>();
+    Map<String, String> attributes = new HashMap<>();
     for (Element propertyAttribute : propertyAttributes) {
       attributes.put(propertyAttribute.getTagName(), propertyAttribute.getFirstChild().getNodeValue());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
index cbf0ff9..515cc63 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
@@ -74,7 +74,7 @@ public class ServiceComponentImpl implements ServiceComponent {
 
   private AmbariMetaInfo ambariMetaInfo;
 
-  private final ConcurrentMap<String, ServiceComponentHost> hostComponents = new ConcurrentHashMap<String, ServiceComponentHost>();
+  private final ConcurrentMap<String, ServiceComponentHost> hostComponents = new ConcurrentHashMap<>();
 
   /**
    * The ID of the persisted {@link ServiceComponentDesiredStateEntity}.
@@ -256,7 +256,7 @@ public class ServiceComponentImpl implements ServiceComponent {
 
   @Override
   public Map<String, ServiceComponentHost> getServiceComponentHosts() {
-    return new HashMap<String, ServiceComponentHost>(hostComponents);
+    return new HashMap<>(hostComponents);
   }
 
   @Override
@@ -583,7 +583,7 @@ public class ServiceComponentImpl implements ServiceComponent {
   }
 
   private Map <String, Integer> getServiceComponentStateCount() {
-    Map <String, Integer> serviceComponentStateCountMap = new HashMap <String, Integer>();
+    Map <String, Integer> serviceComponentStateCountMap = new HashMap<>();
     serviceComponentStateCountMap.put("startedCount", getSCHCountByState(State.STARTED));
     serviceComponentStateCountMap.put("installedCount", getSCHCountByState(State.INSTALLED));
     serviceComponentStateCountMap.put("installFailedCount", getSCHCountByState(State.INSTALL_FAILED));

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
index 4cc1696..0d0b78b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
@@ -92,7 +92,7 @@ public class ServiceInfo implements Validable{
 
   @XmlElementWrapper(name="excluded-config-types")
   @XmlElement(name="config-type")
-  private Set<String> excludedConfigTypes = new HashSet<String>();
+  private Set<String> excludedConfigTypes = new HashSet<>();
 
   @XmlTransient
   private Map<String, Map<String, Map<String, String>>> configTypes;
@@ -186,7 +186,7 @@ public class ServiceInfo implements Validable{
   }
 
   @XmlTransient
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
 
   @Override
   public void addError(String error) {
@@ -260,7 +260,7 @@ public class ServiceInfo implements Validable{
 
   @XmlElementWrapper(name="requiredServices")
   @XmlElement(name="service")
-  private List<String> requiredServices = new ArrayList<String>();
+  private List<String> requiredServices = new ArrayList<>();
 
   /**
    * Meaning: stores subpath from stack root to exact directory, that contains
@@ -382,7 +382,7 @@ public String getVersion() {
     this.requiredServices = requiredServices;
   }
   public List<PropertyInfo> getProperties() {
-    if (properties == null) properties = new ArrayList<PropertyInfo>();
+    if (properties == null) properties = new ArrayList<>();
     return properties;
   }
 
@@ -391,7 +391,7 @@ public String getVersion() {
   }
 
   public List<ComponentInfo> getComponents() {
-    if (components == null) components = new ArrayList<ComponentInfo>();
+    if (components == null) components = new ArrayList<>();
     return components;
   }
 
@@ -601,7 +601,7 @@ public String getVersion() {
    */
   public synchronized void setTypeAttributes(String type, Map<String, Map<String, String>> typeAttributes) {
     if (this.configTypes == null) {
-      configTypes = new HashMap<String, Map<String, Map<String, String>>>();
+      configTypes = new HashMap<>();
     }
     configTypes.put(type, typeAttributes);
   }
@@ -613,7 +613,7 @@ public String getVersion() {
    * @param types map of type attributes
    */
   public synchronized void setAllConfigAttributes(Map<String, Map<String, Map<String, String>>> types) {
-    configTypes = new HashMap<String, Map<String, Map<String, String>>>();
+    configTypes = new HashMap<>();
     for (Map.Entry<String, Map<String, Map<String, String>>> entry : types.entrySet()) {
       setTypeAttributes(entry.getKey(), entry.getValue());
     }
@@ -668,7 +668,7 @@ public String getVersion() {
     if (null == configLayout) {
       synchronized(this) {
         if (null == configLayout) {
-          configLayout = new HashMap<String, Set<String>>();
+          configLayout = new HashMap<>();
 
           for (PropertyInfo pi : getProperties()) {
             String type = pi.getFilename();
@@ -689,7 +689,7 @@ public String getVersion() {
     return configDependencies;
   }
   public List<String> getConfigDependenciesWithComponents(){
-    List<String> retVal = new ArrayList<String>();
+    List<String> retVal = new ArrayList<>();
     if(configDependencies != null){
       retVal.addAll(configDependencies);
     }
@@ -754,7 +754,7 @@ public String getVersion() {
       synchronized (this) { // Double-checked locking pattern
         if (serviceOsSpecificsMap == null) {
           Map<String, ServiceOsSpecific> tmpMap =
-                  new TreeMap<String, ServiceOsSpecific>();
+            new TreeMap<>();
           if (serviceOsSpecifics != null) {
             for (ServiceOsSpecific osSpecific : serviceOsSpecifics) {
               tmpMap.put(osSpecific.getOsFamily(), osSpecific);
@@ -773,7 +773,7 @@ public String getVersion() {
 
   public List<CustomCommandDefinition> getCustomCommands() {
     if (customCommands == null) {
-      customCommands = new ArrayList<CustomCommandDefinition>();
+      customCommands = new ArrayList<>();
     }
     return customCommands;
   }
@@ -904,7 +904,7 @@ public String getVersion() {
       synchronized(this) {
         result = requiredProperties;
         if (result == null) {
-          requiredProperties = result = new HashMap<String, PropertyInfo>();
+          requiredProperties = result = new HashMap<>();
           List<PropertyInfo> properties = getProperties();
           for (PropertyInfo propertyInfo : properties) {
             if (propertyInfo.isRequireInput()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
index 117b11a..032be59 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
@@ -46,7 +46,7 @@ public class ServiceOsSpecific {
 
   @XmlElementWrapper(name="packages")
   @XmlElements(@XmlElement(name="package"))
-  private List<Package> packages = new ArrayList<Package>();
+  private List<Package> packages = new ArrayList<>();
 
 
   public String getOsFamily() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index 3ecc2f9..3ab1466 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -73,13 +73,13 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
   private String upgradesFolder = null;
   private volatile Map<String, PropertyInfo> requiredProperties;
   private Map<String, VersionDefinitionXml> versionDefinitions = new ConcurrentHashMap<>();
-  private Set<String> errorSet = new HashSet<String>();
+  private Set<String> errorSet = new HashSet<>();
   private RepositoryXml repoXml = null;
 
   /**
    * List of services removed from current stack
    * */
-  private List<String> removedServices = new ArrayList<String>();
+  private List<String> removedServices = new ArrayList<>();
 
   public String getMinJdk() {
     return minJdk;
@@ -147,7 +147,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
   }
 
   public List<RepositoryInfo> getRepositories() {
-    if( repositories == null ) repositories = new ArrayList<RepositoryInfo>();
+    if( repositories == null ) repositories = new ArrayList<>();
     return repositories;
   }
 
@@ -159,7 +159,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
   }
 
   public synchronized Collection<ServiceInfo> getServices() {
-    if (services == null) services = new ArrayList<ServiceInfo>();
+    if (services == null) services = new ArrayList<>();
     return services;
   }
 
@@ -179,7 +179,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
   }
 
   public synchronized Collection<ExtensionInfo> getExtensions() {
-    if (extensions == null) extensions = new ArrayList<ExtensionInfo>();
+    if (extensions == null) extensions = new ArrayList<>();
     return extensions;
   }
 
@@ -207,7 +207,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
   }
 
   public List<PropertyInfo> getProperties() {
-    if (properties == null) properties = new ArrayList<PropertyInfo>();
+    if (properties == null) properties = new ArrayList<>();
     return properties;
   }
 
@@ -235,7 +235,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
    */
   public synchronized void setConfigTypeAttributes(String type, Map<String, Map<String, String>> typeAttributes) {
     if (this.configTypes == null) {
-      configTypes = new HashMap<String, Map<String, Map<String, String>>>();
+      configTypes = new HashMap<>();
     }
     // todo: no exclusion mechanism for stack config types
     configTypes.put(type, typeAttributes);
@@ -248,7 +248,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
    * @param types map of type attributes
    */
   public synchronized void setAllConfigAttributes(Map<String, Map<String, Map<String, String>>> types) {
-    configTypes = new HashMap<String, Map<String, Map<String, String>>>();
+    configTypes = new HashMap<>();
     for (Map.Entry<String, Map<String, Map<String, String>>> entry : types.entrySet()) {
       setConfigTypeAttributes(entry.getKey(), entry.getValue());
     }
@@ -305,7 +305,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
     // The collection of service descriptor files. A Set is being used because some Kerberos descriptor
     // files contain multiple services, therefore the same File may be encountered more than once.
     // For example the YARN directory may contain YARN and MAPREDUCE2 services.
-    Collection<File> serviceDescriptorFiles = new HashSet<File>();
+    Collection<File> serviceDescriptorFiles = new HashSet<>();
     if (serviceInfos != null) {
       for (ServiceInfo serviceInfo : serviceInfos) {
         File file = serviceInfo.getKerberosDescriptorFile();
@@ -466,7 +466,7 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
       synchronized(this) {
         result = requiredProperties;
         if (result == null) {
-          requiredProperties = result = new HashMap<String, PropertyInfo>();
+          requiredProperties = result = new HashMap<>();
           List<PropertyInfo> properties = getProperties();
           for (PropertyInfo propertyInfo : properties) {
             if (propertyInfo.isRequireInput()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java
index ee5451f..eee913a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeHelper.java
@@ -407,7 +407,7 @@ public class UpgradeHelper {
               case ROLLING:
                 if (!hostsType.hosts.isEmpty() && hostsType.master != null && hostsType.secondary != null) {
                   // The order is important, first do the standby, then the active namenode.
-                  LinkedHashSet<String> order = new LinkedHashSet<String>();
+                  LinkedHashSet<String> order = new LinkedHashSet<>();
 
                   order.add(hostsType.secondary);
                   order.add(hostsType.master);
@@ -429,17 +429,17 @@ public class UpgradeHelper {
                   // So need to make 2 stages, and add different parameters to each one.
 
                   HostsType ht1 = new HostsType();
-                  LinkedHashSet<String> h1Hosts = new LinkedHashSet<String>();
+                  LinkedHashSet<String> h1Hosts = new LinkedHashSet<>();
                   h1Hosts.add(hostsType.master);
                   ht1.hosts = h1Hosts;
-                  Map<String, String> h1Params = new HashMap<String, String>();
+                  Map<String, String> h1Params = new HashMap<>();
                   h1Params.put("desired_namenode_role", "active");
 
                   HostsType ht2 = new HostsType();
-                  LinkedHashSet<String> h2Hosts = new LinkedHashSet<String>();
+                  LinkedHashSet<String> h2Hosts = new LinkedHashSet<>();
                   h2Hosts.add(hostsType.secondary);
                   ht2.hosts = h2Hosts;
-                  Map<String, String> h2Params = new HashMap<String, String>();
+                  Map<String, String> h2Params = new HashMap<>();
                   h2Params.put("desired_namenode_role", "standby");
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
index 100537c..12dedba 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java
@@ -38,7 +38,7 @@ public class AggregateDefinitionMapping {
    * This is used for fast lookups when receiving events.
    */
   private Map<Long, Map<String, AlertDefinition>> m_aggregateMap =
-      new ConcurrentHashMap<Long, Map<String, AlertDefinition>>();
+    new ConcurrentHashMap<>();
 
   /**
    * Constructor.
@@ -125,7 +125,7 @@ public class AggregateDefinitionMapping {
     }
 
     Map<String, AlertDefinition> map = m_aggregateMap.get(clusterId);
-    return new ArrayList<AlertDefinition>(map.values());
+    return new ArrayList<>(map.values());
   }
 
   /**
@@ -141,6 +141,6 @@ public class AggregateDefinitionMapping {
     }
 
     Map<String, AlertDefinition> map = m_aggregateMap.get(clusterId);
-    return new ArrayList<String>(map.keySet());
+    return new ArrayList<>(map.keySet());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java
index acbb881..1716522 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java
@@ -139,7 +139,7 @@ public class AlertDefinitionFactory {
       IOUtils.closeQuietly(reader);
     }
 
-    Set<AlertDefinition> definitions = new HashSet<AlertDefinition>();
+    Set<AlertDefinition> definitions = new HashSet<>();
 
     // it's OK if the service doesn't have any definitions; this can happen if
     // 2 services are defined in a single metainfo.xml and only 1 service has

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
index 2f1c7ee..616bcdb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java
@@ -120,7 +120,7 @@ public class AlertDefinitionHash {
    * value is a map between cluster name and hash.
    */
   private ConcurrentMap<String, ConcurrentMap<String, String>> m_hashes =
-      new ConcurrentHashMap<String, ConcurrentMap<String, String>>();
+    new ConcurrentHashMap<>();
 
   /**
    * Gets a unique hash value reprssenting all of the alert definitions that
@@ -141,7 +141,7 @@ public class AlertDefinitionHash {
   public String getHash(String clusterName, String hostName) {
     ConcurrentMap<String, String> clusterMapping = m_hashes.get(hostName);
     if (null == clusterMapping) {
-      clusterMapping = new ConcurrentHashMap<String, String>();
+      clusterMapping = new ConcurrentHashMap<>();
       ConcurrentMap<String, String> temp = m_hashes.putIfAbsent(hostName, clusterMapping);
       if (temp != null) {
         clusterMapping = temp;
@@ -237,8 +237,8 @@ public class AlertDefinitionHash {
     Set<AlertDefinitionEntity> entities = getAlertDefinitionEntities(
         clusterName, hostName);
 
-    List<AlertDefinition> definitions = new ArrayList<AlertDefinition>(
-        entities.size());
+    List<AlertDefinition> definitions = new ArrayList<>(
+      entities.size());
 
     for (AlertDefinitionEntity entity : entities) {
       definitions.add(m_factory.coerce(entity));
@@ -364,7 +364,7 @@ public class AlertDefinitionHash {
 
     Map<String, Host> hosts = null;
     String clusterName = cluster.getClusterName();
-    Set<String> affectedHosts = new HashSet<String>();
+    Set<String> affectedHosts = new HashSet<>();
 
     try {
       hosts = m_clusters.get().getHostsForCluster(clusterName);
@@ -588,7 +588,7 @@ public class AlertDefinitionHash {
     }
 
     // build the UUIDs
-    List<String> uuids = new ArrayList<String>(definitions.size());
+    List<String> uuids = new ArrayList<>(definitions.size());
     for (AlertDefinitionEntity definition : definitions) {
       uuids.add(definition.getHash());
     }
@@ -629,7 +629,7 @@ public class AlertDefinitionHash {
   private Set<AlertDefinitionEntity> getAlertDefinitionEntities(
       String clusterName, String hostName) {
 
-    Set<AlertDefinitionEntity> definitions = new HashSet<AlertDefinitionEntity>();
+    Set<AlertDefinitionEntity> definitions = new HashSet<>();
 
     try {
       Cluster cluster = m_clusters.get().getCluster(clusterName);
@@ -655,7 +655,7 @@ public class AlertDefinitionHash {
 
         // for every service, get the master components and see if the host
         // is a master
-        Set<String> services = new HashSet<String>();
+        Set<String> services = new HashSet<>();
         for (Entry<String, Service> entry : cluster.getServices().entrySet()) {
           Service service = entry.getValue();
           Map<String, ServiceComponent> components = service.getServiceComponents();

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
index 32bceca..25734cd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
@@ -145,8 +145,8 @@ public class MetricSource extends Source {
 
       JmxInfo other = (JmxInfo)object;
 
-      List<String> list1 = new ArrayList<String>(propertyList);
-      List<String> list2 = new ArrayList<String>(other.propertyList);
+      List<String> list1 = new ArrayList<>(propertyList);
+      List<String> list2 = new ArrayList<>(other.propertyList);
 
       // !!! even if out of order, this is enough to fail
       return list1.equals(list2);


Mime
View raw message