ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [31/50] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
Date Wed, 29 Mar 2017 22:40:49 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
index 6c89b88..2bc1e68 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
@@ -101,12 +101,12 @@ public class ClustersImpl implements Clusters {
 
   private static final Logger LOG = LoggerFactory.getLogger(ClustersImpl.class);
 
-  private final ConcurrentHashMap<String, Cluster> clusters = new ConcurrentHashMap<String, Cluster>();
-  private final ConcurrentHashMap<Long, Cluster> clustersById = new ConcurrentHashMap<Long, Cluster>();
-  private final ConcurrentHashMap<String, Host> hosts = new ConcurrentHashMap<String, Host>();
-  private final ConcurrentHashMap<Long, Host> hostsById = new ConcurrentHashMap<Long, Host>();
-  private final ConcurrentHashMap<String, Set<Cluster>> hostClusterMap = new ConcurrentHashMap<String, Set<Cluster>>();
-  private final ConcurrentHashMap<String, Set<Host>> clusterHostMap = new ConcurrentHashMap<String, Set<Host>>();
+  private final ConcurrentHashMap<String, Cluster> clusters = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<Long, Cluster> clustersById = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<String, Host> hosts = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<Long, Host> hostsById = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<String, Set<Cluster>> hostClusterMap = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<String, Set<Host>> clusterHostMap = new ConcurrentHashMap<>();
 
   @Inject
   private ClusterDAO clusterDAO;
@@ -324,7 +324,7 @@ public class ClustersImpl implements Clusters {
 
   @Override
   public List<Host> getHosts() {
-    return new ArrayList<Host>(hosts.values());
+    return new ArrayList<>(hosts.values());
   }
 
   @Override
@@ -413,7 +413,7 @@ public class ClustersImpl implements Clusters {
     // not stored to DB
     Host host = hostFactory.create(hostEntity);
     host.setAgentVersion(new AgentVersion(""));
-    List<DiskInfo> emptyDiskList = new CopyOnWriteArrayList<DiskInfo>();
+    List<DiskInfo> emptyDiskList = new CopyOnWriteArrayList<>();
     host.setDisksInfo(emptyDiskList);
     host.setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, ""));
     host.setHostAttributes(new ConcurrentHashMap<String, String>());
@@ -486,7 +486,7 @@ public class ClustersImpl implements Clusters {
   private Map<String, Host> getHostsMap(Collection<String> hostSet) throws
       HostNotFoundException {
 
-    Map<String, Host> hostMap = new HashMap<String, Host>();
+    Map<String, Host> hostMap = new HashMap<>();
     Host host = null;
     for (String hostName : hostSet) {
       if (null != hostName) {
@@ -612,7 +612,7 @@ public class ClustersImpl implements Clusters {
   public Map<String, Host> getHostsForCluster(String clusterName)
       throws AmbariException {
 
-    Map<String, Host> hosts = new HashMap<String, Host>();
+    Map<String, Host> hosts = new HashMap<>();
     for (Host h : clusterHostMap.get(clusterName)) {
       hosts.put(h.getHostName(), h);
     }
@@ -623,7 +623,7 @@ public class ClustersImpl implements Clusters {
   @Override
   public Map<Long, Host> getHostIdsForCluster(String clusterName)
       throws AmbariException {
-    Map<Long, Host> hosts = new HashMap<Long, Host>();
+    Map<Long, Host> hosts = new HashMap<>();
 
     for (Host h : clusterHostMap.get(clusterName)) {
       HostEntity hostEntity = hostDAO.findByName(h.getHostName());

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
index 03edcf8..89a03aa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/configgroup/ConfigGroupImpl.java
@@ -147,8 +147,8 @@ public class ConfigGroupImpl implements ConfigGroup {
     configGroupId = configGroupEntity.getGroupId();
     configGroupName = configGroupEntity.getGroupName();
 
-    m_configurations = new ConcurrentHashMap<String, Config>();
-    m_hosts = new ConcurrentHashMap<Long, Host>();
+    m_configurations = new ConcurrentHashMap<>();
+    m_hosts = new ConcurrentHashMap<>();
 
     // Populate configs
     for (ConfigGroupConfigMappingEntity configMappingEntity : configGroupEntity.getConfigGroupConfigMappingEntities()) {
@@ -478,17 +478,17 @@ public class ConfigGroupImpl implements ConfigGroup {
 
   @Override
   public ConfigGroupResponse convertToResponse() throws AmbariException {
-    Set<Map<String, Object>> hostnames = new HashSet<Map<String, Object>>();
+    Set<Map<String, Object>> hostnames = new HashSet<>();
     for (Host host : m_hosts.values()) {
-      Map<String, Object> hostMap = new HashMap<String, Object>();
+      Map<String, Object> hostMap = new HashMap<>();
       hostMap.put("host_name", host.getHostName());
       hostnames.add(hostMap);
     }
 
-    Set<Map<String, Object>> configObjMap = new HashSet<Map<String, Object>>();
+    Set<Map<String, Object>> configObjMap = new HashSet<>();
 
     for (Config config : m_configurations.values()) {
-      Map<String, Object> configMap = new HashMap<String, Object>();
+      Map<String, Object> configMap = new HashMap<>();
       configMap.put(ConfigurationResourceProvider.CONFIGURATION_CONFIG_TYPE_PROPERTY_ID,
           config.getType());
       configMap.put(ConfigurationResourceProvider.CONFIGURATION_CONFIG_TAG_PROPERTY_ID,

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/fsm/StateMachineFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/fsm/StateMachineFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/state/fsm/StateMachineFactory.java
index c67b829..cc57f2c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/fsm/StateMachineFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/fsm/StateMachineFactory.java
@@ -127,8 +127,7 @@ final public class StateMachineFactory
         // I use HashMap here because I would expect most EVENTTYPE's to not
         //  apply out of a particular state, so FSM sizes would be
         //  quadratic if I use EnumMap's here as I do at the top level.
-        transitionMap = new HashMap<EVENTTYPE,
-          Transition<OPERAND, STATE, EVENTTYPE, EVENT>>();
+        transitionMap = new HashMap<>();
         subject.stateMachineTable.put(preState, transitionMap);
       }
       transitionMap.put(eventType, transition);
@@ -307,7 +306,7 @@ final public class StateMachineFactory
     Stack<ApplicableTransition<OPERAND, STATE, EVENTTYPE, EVENT>> stack = new Stack<>();
 
     Map<STATE, Map<EVENTTYPE, Transition<OPERAND, STATE, EVENTTYPE, EVENT>>>
-      prototype = new HashMap<STATE, Map<EVENTTYPE, Transition<OPERAND, STATE, EVENTTYPE, EVENT>>>();
+      prototype = new HashMap<>();
 
     prototype.put(defaultInitialState, null);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostHealthyHeartbeatEvent.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostHealthyHeartbeatEvent.java b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostHealthyHeartbeatEvent.java
index a3421b1..3d03af2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostHealthyHeartbeatEvent.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/host/HostHealthyHeartbeatEvent.java
@@ -31,7 +31,7 @@ public class HostHealthyHeartbeatEvent extends HostEvent {
 
   private final long heartbeatTime;
   private AgentEnv agentEnv = null;
-  private List<DiskInfo> mounts = new ArrayList<DiskInfo>();;
+  private List<DiskInfo> mounts = new ArrayList<>();;
 
   public HostHealthyHeartbeatEvent(String hostName, long heartbeatTime, AgentEnv env, List<DiskInfo> mounts) {
     super(hostName, HostEventType.HOST_HEARTBEAT_HEALTHY);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
index 2112fcc..9b1fd6b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptor.java
@@ -65,7 +65,7 @@ public abstract class AbstractKerberosDescriptor {
    * @return a Map of date representing this AbstractKerberosDescriptor implementation
    */
   public Map<String, Object> toMap() {
-    TreeMap<String, Object> dataMap = new TreeMap<String, Object>();
+    TreeMap<String, Object> dataMap = new TreeMap<>();
     String name = getName();
 
     if (name != null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
index 53c69f1..73381ee 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/AbstractKerberosDescriptorContainer.java
@@ -200,7 +200,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
   public void setIdentities(List<KerberosIdentityDescriptor> identities) {
     this.identities = (identities == null)
         ? null
-        : new ArrayList<KerberosIdentityDescriptor>(identities);
+        : new ArrayList<>(identities);
   }
 
   /**
@@ -230,7 +230,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
     if (identities == null) {
       return null;
     } else {
-      List<KerberosIdentityDescriptor> list = new ArrayList<KerberosIdentityDescriptor>();
+      List<KerberosIdentityDescriptor> list = new ArrayList<>();
 
       for (KerberosIdentityDescriptor identity : identities) {
         KerberosIdentityDescriptor identityToAdd;
@@ -288,7 +288,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
       String name = identity.getName();
 
       if (identities == null) {
-        identities = new ArrayList<KerberosIdentityDescriptor>();
+        identities = new ArrayList<>();
       }
 
       // If the identity has a name, ensure that one one with that name is in the List
@@ -336,7 +336,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
   public void setConfigurations(Map<String, KerberosConfigurationDescriptor> configurations) {
     this.configurations = (configurations == null)
         ? null
-        : new TreeMap<String, KerberosConfigurationDescriptor>(configurations);
+        : new TreeMap<>(configurations);
   }
 
   /**
@@ -376,8 +376,8 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
    */
   public Map<String, KerberosConfigurationDescriptor> getConfigurations(boolean includeInherited) {
     if (includeInherited) {
-      Map<String, KerberosConfigurationDescriptor> mergedConfigurations = new TreeMap<String, KerberosConfigurationDescriptor>();
-      List<Map<String, KerberosConfigurationDescriptor>> configurationSets = new ArrayList<Map<String, KerberosConfigurationDescriptor>>();
+      Map<String, KerberosConfigurationDescriptor> mergedConfigurations = new TreeMap<>();
+      List<Map<String, KerberosConfigurationDescriptor>> configurationSets = new ArrayList<>();
       AbstractKerberosDescriptor currentDescriptor = this;
 
       // Walk up the hierarchy and collect the configuration sets.
@@ -440,7 +440,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
       }
 
       if (configurations == null) {
-        configurations = new TreeMap<String, KerberosConfigurationDescriptor>();
+        configurations = new TreeMap<>();
       }
 
       configurations.put(type, configuration);
@@ -471,7 +471,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
   public void putAuthToLocalProperty(String authToLocalProperty) {
     if (authToLocalProperty != null) {
       if (authToLocalProperties == null) {
-        authToLocalProperties = new TreeSet<String>();
+        authToLocalProperties = new TreeSet<>();
       }
 
       authToLocalProperties.add(authToLocalProperty);
@@ -486,7 +486,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
   public void setAuthToLocalProperties(Set<String> authToLocalProperties) {
     this.authToLocalProperties = (authToLocalProperties == null)
         ? null
-        : new TreeSet<String>(authToLocalProperties);
+        : new TreeSet<>(authToLocalProperties);
   }
 
   /**
@@ -730,7 +730,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
     if (identities != null) {
       // Use a TreeMap to force the identities definitions to be ordered by name, alphebetically.
       // This helps with readability and comparisons.
-      Map<String, Map<String, Object>> list = new TreeMap<String, Map<String, Object>>();
+      Map<String, Map<String, Object>> list = new TreeMap<>();
       for (KerberosIdentityDescriptor identity : identities) {
         list.put(identity.getName(), identity.toMap());
       }
@@ -740,7 +740,7 @@ public abstract class AbstractKerberosDescriptorContainer extends AbstractKerber
     if (configurations != null) {
       // Use a TreeMap to force the configurations to be ordered by configuration type, alphebetically.
       // This helps with readability and comparisons.
-      Map<String, Map<String, Object>> list = new TreeMap<String, Map<String, Object>>();
+      Map<String, Map<String, Object>> list = new TreeMap<>();
       for (KerberosConfigurationDescriptor configuration : configurations.values()) {
         list.put(configuration.getType(), configuration.toMap());
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptor.java
index 683f97f..7930e38 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosConfigurationDescriptor.java
@@ -113,7 +113,7 @@ public class KerberosConfigurationDescriptor extends AbstractKerberosDescriptor
     if (properties == null) {
       this.properties = null;
     } else {
-      this.properties = new TreeMap<String, String>(properties);
+      this.properties = new TreeMap<>(properties);
     }
   }
 
@@ -150,7 +150,7 @@ public class KerberosConfigurationDescriptor extends AbstractKerberosDescriptor
     }
 
     if (properties == null) {
-      properties = new TreeMap<String, String>();
+      properties = new TreeMap<>();
     }
 
     properties.put(name, value);
@@ -186,7 +186,7 @@ public class KerberosConfigurationDescriptor extends AbstractKerberosDescriptor
    */
   @Override
   public Map<String, Object> toMap() {
-    Map<String, Object> map = new TreeMap<String, Object>();
+    Map<String, Object> map = new TreeMap<>();
     map.put(getName(), (properties == null) ? null : new TreeMap<String, Object>(properties));
     return map;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
index 3596ecd..a1b9e5c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
@@ -154,7 +154,7 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
   public void setServices(Map<String, KerberosServiceDescriptor> services) {
     this.services = (services == null)
         ? null
-        : new TreeMap<String, KerberosServiceDescriptor>(services);
+        : new TreeMap<>(services);
   }
 
   /**
@@ -193,7 +193,7 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
       }
 
       if (services == null) {
-        services = new TreeMap<String, KerberosServiceDescriptor>();
+        services = new TreeMap<>();
       }
 
       services.put(name, service);
@@ -211,7 +211,7 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
   public void setProperties(Map<String, String> properties) {
     this.properties = (properties == null)
         ? null
-        : new TreeMap<String, String>(properties);
+        : new TreeMap<>(properties);
   }
 
   /**
@@ -247,7 +247,7 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
     }
 
     if (properties == null) {
-      properties = new TreeMap<String, String>();
+      properties = new TreeMap<>();
     }
 
     properties.put(name, value);
@@ -318,7 +318,7 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
     Map<String, Object> map = super.toMap();
 
     if (services != null) {
-      List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+      List<Map<String, Object>> list = new ArrayList<>();
       for (KerberosServiceDescriptor service : services.values()) {
         list.add(service.toMap());
       }
@@ -326,7 +326,7 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
     }
 
     if (properties != null) {
-      map.put("properties", new TreeMap<String, String>(properties));
+      map.put("properties", new TreeMap<>(properties));
     }
 
     return map;

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelper.java
index e2a5cce..f05b62b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelper.java
@@ -99,7 +99,7 @@ public class KerberosDescriptorUpdateHelper {
       return userServices;
     }
 
-    Map<String, KerberosServiceDescriptor> updatedServices = new TreeMap<String, KerberosServiceDescriptor>();
+    Map<String, KerberosServiceDescriptor> updatedServices = new TreeMap<>();
 
     if (previousStackServices == null) {
       previousStackServices = Collections.emptyMap();
@@ -257,7 +257,7 @@ public class KerberosDescriptorUpdateHelper {
       return null;
     }
 
-    TreeSet<String> updatedAuthToLocalProperties = new TreeSet<String>(userAuthToLocalProperties);
+    TreeSet<String> updatedAuthToLocalProperties = new TreeSet<>(userAuthToLocalProperties);
 
     // Remove old configuration specifications, leaving the user-specified ones.
     if (previousStackAuthToLocalProperties != null) {
@@ -294,7 +294,7 @@ public class KerberosDescriptorUpdateHelper {
     Map<String, KerberosIdentityDescriptor> newStackIdentityMap = toMap(newStackIdentities);
     Map<String, KerberosIdentityDescriptor> userStackIdentityMap = toMap(userIdentities);
 
-    Map<String, KerberosIdentityDescriptor> updatedIdentities = new TreeMap<String, KerberosIdentityDescriptor>();
+    Map<String, KerberosIdentityDescriptor> updatedIdentities = new TreeMap<>();
 
     if (previousStackIdentityMap == null) {
       previousStackIdentityMap = Collections.emptyMap();
@@ -333,7 +333,7 @@ public class KerberosDescriptorUpdateHelper {
     // Note: there is no need to add identity definitions that do not exist since they will get
     // added dynamically when merged with the stack default value.
 
-    return new ArrayList<KerberosIdentityDescriptor>(updatedIdentities.values());
+    return new ArrayList<>(updatedIdentities.values());
   }
 
 
@@ -423,7 +423,7 @@ public class KerberosDescriptorUpdateHelper {
       return userConfigurations;
     }
 
-    Map<String, KerberosConfigurationDescriptor> updatedConfigurations = new TreeMap<String, KerberosConfigurationDescriptor>();
+    Map<String, KerberosConfigurationDescriptor> updatedConfigurations = new TreeMap<>();
 
     if (previousStackConfigurations == null) {
       previousStackConfigurations = Collections.emptyMap();
@@ -509,7 +509,7 @@ public class KerberosDescriptorUpdateHelper {
     if ((previousStackProperties == null) && (newStackProperties == null)) {
       return userProperties;
     } else {
-      Map<String, String> updatedProperties = new TreeMap<String, String>();
+      Map<String, String> updatedProperties = new TreeMap<>();
       if (userProperties != null) {
         updatedProperties.putAll(userProperties);
       }
@@ -573,7 +573,7 @@ public class KerberosDescriptorUpdateHelper {
     if (identities == null) {
       return null;
     } else {
-      Map<String, KerberosIdentityDescriptor> map = new TreeMap<String, KerberosIdentityDescriptor>();
+      Map<String, KerberosIdentityDescriptor> map = new TreeMap<>();
 
       for (KerberosIdentityDescriptor identity : identities) {
         map.put(identity.getName(), identity);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptor.java
index ccb4efe..a17caad 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosKeytabDescriptor.java
@@ -417,7 +417,7 @@ public class KerberosKeytabDescriptor extends AbstractKerberosDescriptor {
    */
   @Override
   public Map<String, Object> toMap() {
-    Map<String, Object> map = new TreeMap<String, Object>();
+    Map<String, Object> map = new TreeMap<>();
 
     String data;
 
@@ -425,7 +425,7 @@ public class KerberosKeytabDescriptor extends AbstractKerberosDescriptor {
     map.put("file", data);
 
     // Build file owner map
-    Map<String, String> owner = new TreeMap<String, String>();
+    Map<String, String> owner = new TreeMap<>();
 
     data = getOwnerName();
     if (data != null) {
@@ -443,7 +443,7 @@ public class KerberosKeytabDescriptor extends AbstractKerberosDescriptor {
     // Build file owner map (end)
 
     // Build file owner map
-    Map<String, String> group = new TreeMap<String, String>();
+    Map<String, String> group = new TreeMap<>();
 
     data = getGroupName();
     if (data != null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptor.java
index 8fe434e..624e5c3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosPrincipalDescriptor.java
@@ -267,7 +267,7 @@ public class KerberosPrincipalDescriptor extends AbstractKerberosDescriptor {
    */
   @Override
   public Map<String, Object> toMap() {
-    Map<String, Object> map = new TreeMap<String, Object>();
+    Map<String, Object> map = new TreeMap<>();
 
     map.put("value", getValue());
     map.put("type", KerberosPrincipalType.translate(getType()));

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
index 6f31dba..68cafe5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptor.java
@@ -196,7 +196,7 @@ public class KerberosServiceDescriptor extends AbstractKerberosDescriptorContain
       }
 
       if (components == null) {
-        components = new TreeMap<String, KerberosComponentDescriptor>();
+        components = new TreeMap<>();
       }
 
       components.put(name, component);
@@ -262,7 +262,7 @@ public class KerberosServiceDescriptor extends AbstractKerberosDescriptorContain
     Map<String, Object> map = super.toMap();
 
     if (components != null) {
-      List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+      List<Map<String, Object>> list = new ArrayList<>();
       for (KerberosComponentDescriptor component : components.values()) {
         list.add(component.toMap());
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorFactory.java
index 08839c8..3997b87 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosServiceDescriptorFactory.java
@@ -104,7 +104,7 @@ public class KerberosServiceDescriptorFactory extends AbstractKerberosDescriptor
    * @see org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor
    */
   public KerberosServiceDescriptor[] createInstances(Map<String, Object> map) throws AmbariException {
-    ArrayList<KerberosServiceDescriptor> descriptors = new ArrayList<KerberosServiceDescriptor>();
+    ArrayList<KerberosServiceDescriptor> descriptors = new ArrayList<>();
 
     if (map != null) {
       Object servicesData = map.get("services");

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
index f463cee..b9e2841 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
@@ -316,7 +316,7 @@ public class VariableReplacementHelper {
 
       Collection<String> sourceItems = parseItems(sourceData, concatDelimiter);
       Collection<String> dataItems = parseItems(data, concatDelimiter);
-      Collection<String> items = new ArrayList<String>();
+      Collection<String> items = new ArrayList<>();
 
       if (uniqueOnly) {
         for (String item : sourceItems) {
@@ -346,7 +346,7 @@ public class VariableReplacementHelper {
      * @return a Collection of Strings split from the original string
      */
     private Collection<String> parseItems(String delimitedString, String concatDelimiter) {
-      Collection<String> items = new ArrayList<String>();
+      Collection<String> items = new ArrayList<>();
 
       if (!StringUtils.isEmpty(delimitedString)) {
         for (String item : delimitedString.split(concatDelimiter)) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/QuickLinksConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/QuickLinksConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/QuickLinksConfiguration.java
index ae74f7e..50e13d0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/QuickLinksConfiguration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/QuickLinksConfiguration.java
@@ -69,7 +69,7 @@ public class QuickLinksConfiguration{
   }
 
   private List<Link> mergeLinks(List<Link> parentLinks, List<Link> childLinks) {
-    Map<String, Link> mergedLinks = new HashMap<String, Link>();
+    Map<String, Link> mergedLinks = new HashMap<>();
 
     for (Link parentLink : parentLinks) {
       mergedLinks.put(parentLink.getName(), parentLink);
@@ -86,6 +86,6 @@ public class QuickLinksConfiguration{
         }
       }
     }
-    return new ArrayList<Link>(mergedLinks.values());
+    return new ArrayList<>(mergedLinks.values());
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/Batch.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/Batch.java b/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/Batch.java
index a3d9b42..6d58e21 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/Batch.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/Batch.java
@@ -24,7 +24,7 @@ import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
 
 public class Batch {
-  private final List<BatchRequest> batchRequests = new ArrayList<BatchRequest>();
+  private final List<BatchRequest> batchRequests = new ArrayList<>();
   private BatchSettings batchSettings;
 
   @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/BatchRequestJob.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/BatchRequestJob.java b/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/BatchRequestJob.java
index cb3faf7..71349a1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/BatchRequestJob.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/scheduler/BatchRequestJob.java
@@ -141,7 +141,7 @@ public class BatchRequestJob extends AbstractLinearExecutionJob {
                                         Map<String, Integer> oldCounts,
                                         BatchRequestResponse batchRequestResponse) {
 
-    Map<String, Integer> taskCounts = new HashMap<String, Integer>();
+    Map<String, Integer> taskCounts = new HashMap<>();
 
     if (batchRequestResponse != null) {
       Integer failedTasks = batchRequestResponse.getFailedTaskCount() +
@@ -163,7 +163,7 @@ public class BatchRequestJob extends AbstractLinearExecutionJob {
   }
 
   private Map<String, Integer> getTaskCountProperties(Map<String, Object> properties) {
-    Map<String, Integer> taskCounts = new HashMap<String, Integer>();
+    Map<String, Integer> taskCounts = new HashMap<>();
     if (properties != null) {
       Object countObj = properties.get(BATCH_REQUEST_FAILED_TASKS_KEY);
       taskCounts.put(BATCH_REQUEST_FAILED_TASKS_KEY,

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
index 47f3989..3f88e5a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java
@@ -280,7 +280,7 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
         pending.size());
 
     Map<AlertTargetEntity, List<AlertNoticeEntity>> aggregateMap =
-        new HashMap<AlertTargetEntity, List<AlertNoticeEntity>>(pending.size());
+      new HashMap<>(pending.size());
 
     // combine all histories by target
     for (AlertNoticeEntity notice : pending) {
@@ -288,7 +288,7 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
 
       List<AlertNoticeEntity> notices = aggregateMap.get(target);
       if (null == notices) {
-        notices = new ArrayList<AlertNoticeEntity>();
+        notices = new ArrayList<>();
         aggregateMap.put(target, notices);
       }
 
@@ -313,9 +313,9 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
       // create a single digest notification if supported
       if (dispatcher.isDigestSupported()) {
         AlertNotification notification = buildNotificationFromTarget(target);
-        notification.CallbackIds = new ArrayList<String>(notices.size());
-        List<AlertHistoryEntity> histories = new ArrayList<AlertHistoryEntity>(
-            notices.size());
+        notification.CallbackIds = new ArrayList<>(notices.size());
+        List<AlertHistoryEntity> histories = new ArrayList<>(
+          notices.size());
 
         // add callback IDs so that the notices can be marked as DELIVERED or
         // FAILED, and create a list of just the alert histories
@@ -416,8 +416,8 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
 
     // create recipients
     if (null != targetProperties.Recipients) {
-      List<Recipient> recipients = new ArrayList<Recipient>(
-          targetProperties.Recipients.size());
+      List<Recipient> recipients = new ArrayList<>(
+        targetProperties.Recipients.size());
 
       for (String stringRecipient : targetProperties.Recipients) {
         Recipient recipient = new Recipient();
@@ -603,7 +603,7 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
         JsonDeserializationContext context) throws JsonParseException {
 
       AlertTargetProperties properties = new AlertTargetProperties();
-      properties.Properties = new HashMap<String, String>();
+      properties.Properties = new HashMap<>();
 
       final JsonObject jsonObject = json.getAsJsonObject();
       Set<Entry<String, JsonElement>> entrySet = jsonObject.entrySet();
@@ -846,12 +846,12 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
     /**
      * The hosts that have at least 1 alert reported.
      */
-    private final Set<String> m_hosts = new HashSet<String>();
+    private final Set<String> m_hosts = new HashSet<>();
 
     /**
      * The services that have at least 1 alert reported.
      */
-    private final Set<String> m_services = new HashSet<String>();
+    private final Set<String> m_services = new HashSet<>();
 
     /**
      * All of the alerts for the {@link Notification}.
@@ -862,17 +862,17 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
      * A mapping of service to alerts where the alerts are also grouped by state
      * for that service.
      */
-    private final Map<String, Map<AlertState, List<AlertHistoryEntity>>> m_alertsByServiceAndState = new HashMap<String, Map<AlertState, List<AlertHistoryEntity>>>();
+    private final Map<String, Map<AlertState, List<AlertHistoryEntity>>> m_alertsByServiceAndState = new HashMap<>();
 
     /**
      * A mapping of all services by state.
      */
-    private final Map<String, Set<String>> m_servicesByState = new HashMap<String, Set<String>>();
+    private final Map<String, Set<String>> m_servicesByState = new HashMap<>();
 
     /**
      * A mapping of all alerts by the service that owns them.
      */
-    private final Map<String, List<AlertHistoryEntity>> m_alertsByService = new HashMap<String, List<AlertHistoryEntity>>();
+    private final Map<String, List<AlertHistoryEntity>> m_alertsByService = new HashMap<>();
 
     /**
      * Constructor.
@@ -899,13 +899,13 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
         // group alerts by service name & state
         Map<AlertState, List<AlertHistoryEntity>> service = m_alertsByServiceAndState.get(serviceName);
         if (null == service) {
-          service = new HashMap<AlertState, List<AlertHistoryEntity>>();
+          service = new HashMap<>();
           m_alertsByServiceAndState.put(serviceName, service);
         }
 
         List<AlertHistoryEntity> alertList = service.get(alertState);
         if (null == alertList) {
-          alertList = new ArrayList<AlertHistoryEntity>();
+          alertList = new ArrayList<>();
           service.put(alertState, alertList);
         }
 
@@ -914,7 +914,7 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
         // group services by alert states
         Set<String> services = m_servicesByState.get(alertState.name());
         if (null == services) {
-          services = new HashSet<String>();
+          services = new HashSet<>();
           m_servicesByState.put(alertState.name(), services);
         }
 
@@ -923,7 +923,7 @@ public class AlertNoticeDispatchService extends AbstractScheduledService {
         // group alerts by service
         List<AlertHistoryEntity> alertsByService = m_alertsByService.get(serviceName);
         if (null == alertsByService) {
-          alertsByService = new ArrayList<AlertHistoryEntity>();
+          alertsByService = new ArrayList<>();
           m_alertsByService.put(serviceName, alertsByService);
         }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
index 85fd92a..f628e29 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
@@ -93,7 +93,7 @@ public class AmbariServerAlertService extends AbstractScheduledService {
   /**
    * A map of all of the definition names to {@link ScheduledFuture}s.
    */
-  private final Map<String, ScheduledAlert> m_futureMap = new ConcurrentHashMap<String, ScheduledAlert>();
+  private final Map<String, ScheduledAlert> m_futureMap = new ConcurrentHashMap<>();
 
   /**
    * Constructor.

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigurationXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigurationXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigurationXml.java
index c3d9182..41fcfa2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigurationXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ConfigurationXml.java
@@ -41,10 +41,10 @@ import org.apache.ambari.server.state.PropertyInfo;
 public class ConfigurationXml implements Validable{
   
   @XmlAnyAttribute
-  private Map<QName, String> attributes = new HashMap<QName, String>();
+  private Map<QName, String> attributes = new HashMap<>();
 
   @XmlElement(name="property")
-  private List<PropertyInfo> properties = new ArrayList<PropertyInfo>();
+  private List<PropertyInfo> properties = new ArrayList<>();
 
   @XmlTransient
   private boolean valid = true;
@@ -68,7 +68,7 @@ public class ConfigurationXml implements Validable{
   }
 
   @XmlTransient
-  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/state/stack/ExtensionMetainfoXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ExtensionMetainfoXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ExtensionMetainfoXml.java
index 790e514..77a7250 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ExtensionMetainfoXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ExtensionMetainfoXml.java
@@ -59,11 +59,11 @@ public class ExtensionMetainfoXml implements Validable{
     }
     @XmlElementWrapper(name="min-stack-versions")
     @XmlElements(@XmlElement(name="stack"))
-    private List<Stack> stacks = new ArrayList<Stack>();
+    private List<Stack> stacks = new ArrayList<>();
 
     @XmlElementWrapper(name="min-extension-versions")
     @XmlElements(@XmlElement(name="extension"))
-    private List<Extension> extensions = new ArrayList<Extension>();
+    private List<Extension> extensions = new ArrayList<>();
 
     public List<Stack> getStacks() {
       return stacks;
@@ -96,7 +96,7 @@ public class ExtensionMetainfoXml implements Validable{
   }
 
   @XmlTransient
-  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/state/stack/MetricDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
index 706db76..b9006cd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
@@ -58,7 +58,7 @@ public class MetricDefinition {
    */
   @JsonIgnore
   public Map<String, Metric> getMetrics() {
-    Map<String, Metric> metricMap = new HashMap<String, Metric>();
+    Map<String, Metric> metricMap = new HashMap<>();
     for (Entry<String, Map<String, Metric>> metricMapEntry : metrics.entrySet()) {
       metricMap.putAll(metricMapEntry.getValue());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
index 1300172..a00b3cd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
@@ -101,7 +101,7 @@ public class OsFamily {
      * @return separated os name and os version
      */
     private Map<String,String> parse_os(String os){
-      Map<String,String> pos = new HashMap<String,String>();
+      Map<String,String> pos = new HashMap<>();
 
       Pattern r = Pattern.compile(os_pattern);
       Matcher m = r.matcher(os);
@@ -126,7 +126,7 @@ public class OsFamily {
       for ( String family : osMap.keySet()) {
         JsonOsFamilyEntry fam = osMap.get(family);
         if (fam.getDistro().contains(pos.get(OS_DISTRO)) && fam.getVersions().contains(pos.get(OS_VERSION))){
-          Set<String> data=new HashSet<String>();
+          Set<String> data= new HashSet<>();
           for (String item: fam.getDistro()) {
             data.add(item + pos.get(OS_VERSION));
           }
@@ -173,11 +173,11 @@ public class OsFamily {
      * @return one dimension list with os types
      */
     public Set<String> os_list(){
-      Set<String> r= new HashSet<String>();
+      Set<String> r= new HashSet<>();
       for ( String family : osMap.keySet()) {
         JsonOsFamilyEntry fam = osMap.get(family);
         for (String version: fam.getVersions()){
-          Set<String> data=new HashSet<String>();
+          Set<String> data= new HashSet<>();
           for (String item: fam.getDistro()) {
             data.add(item + version);
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/PrerequisiteCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/PrerequisiteCheck.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/PrerequisiteCheck.java
index 5822abd..0e605dd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/PrerequisiteCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/PrerequisiteCheck.java
@@ -33,8 +33,8 @@ public class PrerequisiteCheck {
   private final String m_clusterName;
   private PrereqCheckStatus m_status = PrereqCheckStatus.PASS;
   private String m_failReason = "";
-  private LinkedHashSet<String> m_failedOn = new LinkedHashSet<String>();
-  private List<Object> m_failedDetail = new ArrayList<Object>();
+  private LinkedHashSet<String> m_failedOn = new LinkedHashSet<>();
+  private List<Object> m_failedDetail = new ArrayList<>();
 
   public PrerequisiteCheck(CheckDescription description, String clusterName) {
     m_description = description;

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
index 17ded10..078b4ae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/RepositoryXml.java
@@ -43,7 +43,7 @@ public class RepositoryXml implements Validable{
   @XmlElement(name="latest")
   private String latestUri;
   @XmlElement(name="os")
-  private List<Os> oses = new ArrayList<Os>();
+  private List<Os> oses = new ArrayList<>();
 
   @XmlTransient
   private boolean valid = true;
@@ -67,7 +67,7 @@ public class RepositoryXml implements Validable{
   }
 
   @XmlTransient
-  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/state/stack/ServiceMetainfoXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ServiceMetainfoXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ServiceMetainfoXml.java
index 48a4cdf..534874a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ServiceMetainfoXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/ServiceMetainfoXml.java
@@ -70,7 +70,7 @@ public class ServiceMetainfoXml implements Validable{
   }
 
   @XmlTransient
-  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/state/stack/StackMetainfoXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackMetainfoXml.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackMetainfoXml.java
index 9b30754..01f368a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackMetainfoXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackMetainfoXml.java
@@ -78,7 +78,7 @@ public class StackMetainfoXml implements Validable{
   }
   
   @XmlTransient
-  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/state/stack/StackRoleCommandOrder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
index 5696baa..9f9ded6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/StackRoleCommandOrder.java
@@ -95,7 +95,7 @@ public class StackRoleCommandOrder {
    */
 
   public void merge(StackRoleCommandOrder parent, boolean mergeProperties) {
-    HashMap<String, Object> mergedRoleCommandOrders = new HashMap<String, Object>();
+    HashMap<String, Object> mergedRoleCommandOrders = new HashMap<>();
     HashMap<String, Object> parentData = parent.getContent();
 
     List<String> keys = Arrays.asList(GENERAL_DEPS_KEY, GLUSTERFS_DEPS_KEY, NO_GLUSTERFS_DEPS_KEY,
@@ -103,7 +103,7 @@ public class StackRoleCommandOrder {
 
     for (String key : keys) {
       if (parentData.containsKey(key) && content.containsKey(key)) {
-        Map<String, Object> result = new HashMap<String, Object>();
+        Map<String, Object> result = new HashMap<>();
         Map<String, Object> parentProperties = (Map<String, Object>) parentData.get(key);
         Map<String, Object> childProperties = (Map<String, Object>) content.get(key);
         MultiValueMap childAndParentProperties = null;
@@ -116,7 +116,7 @@ public class StackRoleCommandOrder {
           List propertyValues = (List) childAndParentProperties.get(property);
           Object values = propertyValues.get(0);
           if (mergeProperties) {
-            List<String> valueList = new ArrayList<String>();
+            List<String> valueList = new ArrayList<>();
             for (Object value : propertyValues) {
               if (value instanceof List) {
                 valueList.addAll((List<String>) value);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
index d8676bd..21aee06 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/UpgradePack.java
@@ -148,7 +148,7 @@ public class UpgradePack {
    * @return the preCheck name, e.g. "CheckDescription"
    */
   public List<String> getPrerequisiteChecks() {
-    return new ArrayList<String>(prerequisiteChecks.checks);
+    return new ArrayList<>(prerequisiteChecks.checks);
   }
 
   /**
@@ -179,7 +179,7 @@ public class UpgradePack {
     }
 
     if (prerequisiteChecks.checks == null) {
-      prerequisiteChecks.checks = new ArrayList<String>();
+      prerequisiteChecks.checks = new ArrayList<>();
     }
     if (newPrereqChecks.checks != null) {
       prerequisiteChecks.checks.addAll(newPrereqChecks.checks);
@@ -194,10 +194,10 @@ public class UpgradePack {
       return;
     }
     if (prerequisiteChecks.configuration.globalProperties == null) {
-      prerequisiteChecks.configuration.globalProperties = new ArrayList<PrerequisiteProperty>();
+      prerequisiteChecks.configuration.globalProperties = new ArrayList<>();
     }
     if (prerequisiteChecks.configuration.prerequisiteCheckProperties == null) {
-      prerequisiteChecks.configuration.prerequisiteCheckProperties = new ArrayList<PrerequisiteCheckProperties>();
+      prerequisiteChecks.configuration.prerequisiteCheckProperties = new ArrayList<>();
     }
     if (newPrereqChecks.configuration.globalProperties != null) {
       prerequisiteChecks.configuration.globalProperties.addAll(newPrereqChecks.configuration.globalProperties);
@@ -285,7 +285,7 @@ public class UpgradePack {
    * @return the list of groups
    */
   public List<Grouping> getGroups(Direction direction) {
-    List<Grouping> list = new ArrayList<Grouping>();
+    List<Grouping> list = new ArrayList<>();
     if (direction.isUpgrade()) {
       list = groups;
     } else {
@@ -301,7 +301,7 @@ public class UpgradePack {
       }
     }
 
-    List<Grouping> checked = new ArrayList<Grouping>();
+    List<Grouping> checked = new ArrayList<>();
     for (Grouping group : list) {
       if (null == group.intendedDirection || direction == group.intendedDirection) {
         checked.add(group);
@@ -361,7 +361,7 @@ public class UpgradePack {
    * @return the list of groups, reversed appropriately for a downgrade.
    */
   private List<Grouping> getDowngradeGroupsForRolling() {
-    List<Grouping> reverse = new ArrayList<Grouping>();
+    List<Grouping> reverse = new ArrayList<>();
 
     // !!! Testing exposed groups.size() == 1 issue.  Normally there's no precedent for
     // a one-group upgrade pack, so take it into account anyway.
@@ -397,7 +397,7 @@ public class UpgradePack {
   }
 
   private List<Grouping> getDowngradeGroupsForNonrolling() {
-    List<Grouping> list = new ArrayList<Grouping>();
+    List<Grouping> list = new ArrayList<>();
     for (Grouping g : groups) {
       list.add(g);
     }
@@ -438,7 +438,7 @@ public class UpgradePack {
    * maps those to service name, initializing {@link #m_process} to the result.
    */
   private void initializeProcessingComponentMappings() {
-    m_process = new LinkedHashMap<String, Map<String, ProcessingComponent>>();
+    m_process = new LinkedHashMap<>();
 
     if (null == processing || processing.isEmpty()) {
       return;
@@ -449,7 +449,7 @@ public class UpgradePack {
 
       // initialize mapping if not present for the given service name
       if (null == componentMap) {
-        componentMap = new LinkedHashMap<String, ProcessingComponent>();
+        componentMap = new LinkedHashMap<>();
         m_process.put(svc.name, componentMap);
       }
 
@@ -590,7 +590,7 @@ public class UpgradePack {
      * List of additional prerequisite checks to run in addition to required prerequisite checks
      */
     @XmlElement(name="check", type=String.class)
-    public List<String> checks = new ArrayList<String>();
+    public List<String> checks = new ArrayList<>();
 
     /**
      * Prerequisite checks configuration
@@ -623,7 +623,7 @@ public class UpgradePack {
       if(globalProperties == null) {
         return null;
       }
-      Map<String, String> result = new HashMap<String, String>();
+      Map<String, String> result = new HashMap<>();
       for (PrerequisiteProperty property : globalProperties) {
         result.put(property.name, property.value);
       }
@@ -673,7 +673,7 @@ public class UpgradePack {
         return null;
       }
 
-      Map<String, String> result = new HashMap<String, String>();
+      Map<String, String> result = new HashMap<>();
       for (PrerequisiteProperty property : properties) {
         result.put(property.name, property.value);
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
index c45ec24..5cebade 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
@@ -224,7 +224,7 @@ public class ClusterGrouping extends Grouping {
       if (null == hosts || hosts.hosts.isEmpty()) {
         return null;
       } else {
-        realHosts = new LinkedHashSet<String>(hosts.hosts);
+        realHosts = new LinkedHashSet<>(hosts.hosts);
       }
     }
 
@@ -269,7 +269,7 @@ public class ClusterGrouping extends Grouping {
 
       if (hosts != null) {
 
-        Set<String> realHosts = new LinkedHashSet<String>(hosts.hosts);
+        Set<String> realHosts = new LinkedHashSet<>(hosts.hosts);
         if (ExecuteHostType.MASTER == et.hosts && null != hosts.master) {
           realHosts = Collections.singleton(hosts.master);
         }
@@ -300,7 +300,7 @@ public class ClusterGrouping extends Grouping {
       // no service and no component will distributed the task to all healthy
       // hosts not in maintenance mode
       Cluster cluster = ctx.getCluster();
-      Set<String> hostNames = new HashSet<String>();
+      Set<String> hostNames = new HashSet<>();
       for (Host host : ctx.getCluster().getHosts()) {
         MaintenanceState maintenanceState = host.getMaintenanceState(cluster.getClusterId());
         if (maintenanceState == MaintenanceState.OFF) {
@@ -349,7 +349,7 @@ public class ClusterGrouping extends Grouping {
   @Override
   public void merge(Iterator<Grouping> iterator) throws AmbariException {
     if (executionStages == null) {
-      executionStages = new ArrayList<ExecuteStage>();
+      executionStages = new ArrayList<>();
     }
     Map<String, List<ExecuteStage>> skippedStages = new HashMap<>();
     while (iterator.hasNext()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
index a68a385..c939320 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ColocatedGrouping.java
@@ -69,8 +69,8 @@ public class ColocatedGrouping extends Grouping {
     private boolean m_serviceCheck = true;
 
     // !!! host -> list of tasks
-    private Map<String, List<TaskProxy>> initialBatch = new LinkedHashMap<String, List<TaskProxy>>();
-    private Map<String, List<TaskProxy>> finalBatches = new LinkedHashMap<String, List<TaskProxy>>();
+    private Map<String, List<TaskProxy>> initialBatch = new LinkedHashMap<>();
+    private Map<String, List<TaskProxy>> finalBatches = new LinkedHashMap<>();
 
 
     private MultiHomedBuilder(Grouping grouping, Batch batch, boolean serviceCheck) {
@@ -96,7 +96,7 @@ public class ColocatedGrouping extends Grouping {
         Map<String, List<TaskProxy>> targetMap = ((i++) < count) ? initialBatch : finalBatches;
         List<TaskProxy> targetList = targetMap.get(host);
         if (null == targetList) {
-          targetList = new ArrayList<TaskProxy>();
+          targetList = new ArrayList<>();
           targetMap.put(host, targetList);
         }
 
@@ -162,7 +162,7 @@ public class ColocatedGrouping extends Grouping {
     @Override
     public List<StageWrapper> build(UpgradeContext upgradeContext,
         List<StageWrapper> stageWrappers) {
-      List<StageWrapper> results = new ArrayList<StageWrapper>(stageWrappers);
+      List<StageWrapper> results = new ArrayList<>(stageWrappers);
 
       if (LOG.isDebugEnabled()) {
         LOG.debug("RU initial: {}", initialBatch);
@@ -176,7 +176,7 @@ public class ColocatedGrouping extends Grouping {
 
         ManualTask task = new ManualTask();
         task.summary = m_batch.summary;
-        List<String> messages =  new ArrayList<String>();
+        List<String> messages = new ArrayList<>();
         messages.add(m_batch.message);
         task.messages = messages;
         formatFirstBatch(upgradeContext, task, befores);
@@ -196,15 +196,15 @@ public class ColocatedGrouping extends Grouping {
 
     private List<StageWrapper> fromProxies(Direction direction,
         Map<String, List<TaskProxy>> wrappers) {
-      List<StageWrapper> results = new ArrayList<StageWrapper>();
+      List<StageWrapper> results = new ArrayList<>();
 
-      Set<String> serviceChecks = new HashSet<String>();
+      Set<String> serviceChecks = new HashSet<>();
 
       for (Entry<String, List<TaskProxy>> entry : wrappers.entrySet()) {
 
         // !!! stage per host, per type
         StageWrapper wrapper = null;
-        List<StageWrapper> execwrappers = new ArrayList<StageWrapper>();
+        List<StageWrapper> execwrappers = new ArrayList<>();
 
         for (TaskProxy t : entry.getValue()) {
           if (!t.clientOnly) {
@@ -232,8 +232,8 @@ public class ColocatedGrouping extends Grouping {
 
       if (direction.isUpgrade() && m_serviceCheck && serviceChecks.size() > 0) {
         // !!! add the service check task
-        List<TaskWrapper> tasks = new ArrayList<TaskWrapper>();
-        Set<String> displays = new HashSet<String>();
+        List<TaskWrapper> tasks = new ArrayList<>();
+        Set<String> displays = new HashSet<>();
         for (String service : serviceChecks) {
           tasks.add(new TaskWrapper(service, "", Collections.<String>emptySet(), new ServiceCheckTask()));
           displays.add(service);
@@ -257,8 +257,8 @@ public class ColocatedGrouping extends Grouping {
      * @param wrappers  the list of stage wrappers
      */
     private void formatFirstBatch(UpgradeContext ctx, ManualTask task, List<StageWrapper> wrappers) {
-      Set<String> names = new LinkedHashSet<String>();
-      Map<String, Set<String>> compLocations = new HashMap<String, Set<String>>();
+      Set<String> names = new LinkedHashSet<>();
+      Map<String, Set<String>> compLocations = new HashMap<>();
 
       for (StageWrapper sw : wrappers) {
         for (TaskWrapper tw : sw.getTasks()) {
@@ -284,7 +284,7 @@ public class ColocatedGrouping extends Grouping {
         if (message.contains("{{components}}")) {
           StringBuilder sb = new StringBuilder();
 
-          List<String> compNames = new ArrayList<String>(names);
+          List<String> compNames = new ArrayList<>(names);
 
           if (compNames.size() == 1) {
             sb.append(compNames.get(0));
@@ -333,7 +333,7 @@ public class ColocatedGrouping extends Grouping {
     private String message;
     private Type type;
     private boolean clientOnly = false;
-    private List<TaskWrapper> tasks = new ArrayList<TaskWrapper>();
+    private List<TaskWrapper> tasks = new ArrayList<>();
 
     @Override
     public String toString() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
index b7be2ec..927881c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigureTask.java
@@ -217,7 +217,7 @@ public class ConfigureTask extends ServerSideActionTask {
 
     // replacements
 
-    List<Replace> replacements = new ArrayList<Replace>();
+    List<Replace> replacements = new ArrayList<>();
     replacements.addAll(definition.getReplacements());
     //Fetch the replacements that used regex to find a string
     replacements.addAll(definition.getRegexReplacements(cluster));

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
index 8003223..cd17a70 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/Grouping.java
@@ -71,7 +71,7 @@ public class Grouping {
   public boolean allowRetry = true;
 
   @XmlElement(name="service")
-  public List<UpgradePack.OrderService> services = new ArrayList<UpgradePack.OrderService>();
+  public List<UpgradePack.OrderService> services = new ArrayList<>();
 
   @XmlElement(name="service-check", defaultValue="true")
   public boolean performServiceCheck = true;
@@ -101,8 +101,8 @@ public class Grouping {
 
   private static class DefaultBuilder extends StageWrapperBuilder {
 
-    private List<StageWrapper> m_stages = new ArrayList<StageWrapper>();
-    private Set<String> m_servicesToCheck = new HashSet<String>();
+    private List<StageWrapper> m_stages = new ArrayList<>();
+    private Set<String> m_servicesToCheck = new HashSet<>();
     private boolean m_serviceCheck = true;
 
     private DefaultBuilder(Grouping grouping, boolean serviceCheck) {
@@ -166,7 +166,7 @@ public class Grouping {
      * @return List of list of TaskWrappers, where each outer list is a separate stage.
      */
     private List<List<TaskWrapper>> organizeTaskWrappersBySyncRules(List<TaskWrapper> tasks) {
-      List<List<TaskWrapper>> groupedTasks = new ArrayList<List<TaskWrapper>>();
+      List<List<TaskWrapper>> groupedTasks = new ArrayList<>();
 
       List<TaskWrapper> subTasks = new ArrayList<>();
       for (TaskWrapper tw : tasks) {
@@ -247,8 +247,8 @@ public class Grouping {
         m_stages.addAll(0, stageWrappers);
       }
 
-      List<TaskWrapper> tasks = new ArrayList<TaskWrapper>();
-      List<String> displays = new ArrayList<String>();
+      List<TaskWrapper> tasks = new ArrayList<>();
+      List<String> displays = new ArrayList<>();
       for (String service : m_servicesToCheck) {
         tasks.add(new TaskWrapper(
             service, "", Collections.<String>emptySet(), new ServiceCheckTask()));
@@ -277,7 +277,7 @@ public class Grouping {
       return Collections.emptyList();
     }
 
-    List<TaskBucket> holders = new ArrayList<TaskBucket>();
+    List<TaskBucket> holders = new ArrayList<>();
 
     TaskBucket current = null;
 
@@ -301,7 +301,7 @@ public class Grouping {
 
   private static class TaskBucket {
     private StageWrapper.Type type;
-    private List<Task> tasks = new ArrayList<Task>();
+    private List<Task> tasks = new ArrayList<>();
     private TaskBucket(Task initial) {
       switch (initial.getType()) {
         case CONFIGURE:

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
index 7d5cbd0..fdb7c8d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
@@ -86,7 +86,7 @@ public class RepositoryVersionHelper {
    * @throws Exception if any kind of json parsing error happened
    */
   public List<OperatingSystemEntity> parseOperatingSystems(String repositoriesJson) throws Exception {
-    final List<OperatingSystemEntity> operatingSystems = new ArrayList<OperatingSystemEntity>();
+    final List<OperatingSystemEntity> operatingSystems = new ArrayList<>();
     final JsonArray rootJson = new JsonParser().parse(repositoriesJson).getAsJsonArray();
     for (JsonElement operatingSystemJson: rootJson) {
       JsonObject osObj = operatingSystemJson.getAsJsonObject();

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
index 6a085f3..dbfce48 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServiceCheckGrouping.java
@@ -58,14 +58,14 @@ public class ServiceCheckGrouping extends Grouping {
    */
   @XmlElementWrapper(name="priority")
   @XmlElement(name="service")
-  private Set<String> priorityServices = new LinkedHashSet<String>();
+  private Set<String> priorityServices = new LinkedHashSet<>();
 
   /**
    * During a Rolling Upgrade, exclude certain services.
    */
   @XmlElementWrapper(name="exclude")
   @XmlElement(name="service")
-  private Set<String> excludeServices = new HashSet<String>();
+  private Set<String> excludeServices = new HashSet<>();
 
   /**
    * {@inheritDoc}
@@ -125,14 +125,14 @@ public class ServiceCheckGrouping extends Grouping {
       m_cluster = upgradeContext.getCluster();
       m_metaInfo = upgradeContext.getAmbariMetaInfo();
 
-      List<StageWrapper> result = new ArrayList<StageWrapper>(stageWrappers);
+      List<StageWrapper> result = new ArrayList<>(stageWrappers);
       if (upgradeContext.getDirection().isDowngrade()) {
         return result;
       }
 
       Map<String, Service> serviceMap = m_cluster.getServices();
 
-      Set<String> clusterServices = new LinkedHashSet<String>(serviceMap.keySet());
+      Set<String> clusterServices = new LinkedHashSet<>(serviceMap.keySet());
 
       // create stages for the priorities
       for (String service : priorityServices) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
index 669d50f..aac8935 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/StageWrapper.java
@@ -85,7 +85,7 @@ public class StageWrapper {
    * Gets the tasks json.
    */
   public String getTasksJson() {
-    List<Task> realTasks = new ArrayList<Task>();
+    List<Task> realTasks = new ArrayList<>();
     for (TaskWrapper tw : tasks) {
       realTasks.addAll(tw.getTasks());
     }
@@ -97,7 +97,7 @@ public class StageWrapper {
    * @return the set of hosts for all tasks
    */
   public Set<String> getHosts() {
-    Set<String> hosts = new HashSet<String>();
+    Set<String> hosts = new HashSet<>();
     for (TaskWrapper tw : tasks) {
       hosts.addAll(tw.getHosts());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
index 36e71f9..bd2bf14 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
@@ -52,7 +52,7 @@ public class TaskWrapperBuilder {
     // to create.
     String ambariServerHostname = StageUtils.getHostName();
 
-    List<TaskWrapper> collection = new ArrayList<TaskWrapper>();
+    List<TaskWrapper> collection = new ArrayList<>();
     for (Task t : tasks) {
       if (t.getType().equals(Task.Type.CONFIGURE) || t.getType().equals(Task.Type.MANUAL)) {
         // only add the CONFIGURE/MANUAL task if there are actual hosts for the service/component
@@ -111,7 +111,7 @@ public class TaskWrapperBuilder {
    * @return Returns the union of the hosts scheduled to perform the tasks.
    */
   public static Set<String> getEffectiveHosts(List<TaskWrapper> tasks) {
-    Set<String> effectiveHosts = new HashSet<String>();
+    Set<String> effectiveHosts = new HashSet<>();
     for(TaskWrapper t : tasks) {
       effectiveHosts.addAll(t.getHosts());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index 6e4979c..f1e93ac 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -1428,7 +1428,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
 
     for (Entry<String, Map<String, String>> entry : configTags.entrySet()) {
       String type = entry.getKey();
-      Map<String, String> values = new HashMap<String, String>(entry.getValue());
+      Map<String, String> values = new HashMap<>(entry.getValue());
 
       String tag = values.get(ConfigHelper.CLUSTER_DEFAULT_TAG);
       values.remove(ConfigHelper.CLUSTER_DEFAULT_TAG);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java
index 3bf48ca..840dbf0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java
@@ -60,7 +60,7 @@ public class Layout{
   }
 
   private List<Tab> mergeTabs(List<Tab> parentTabs, List<Tab> childTabs) {
-    Map<String, Tab> mergedTabs = new HashMap<String, Tab>();
+    Map<String, Tab> mergedTabs = new HashMap<>();
     for (Tab parentTab : parentTabs) {
       mergedTabs.put(parentTab.getName(), parentTab);
     }
@@ -76,7 +76,7 @@ public class Layout{
         }
       }
     }
-    return new ArrayList<Tab>(mergedTabs.values());
+    return new ArrayList<>(mergedTabs.values());
   }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Placement.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Placement.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Placement.java
index 2aebc5f..0525c84 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Placement.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Placement.java
@@ -67,7 +67,7 @@ public class Placement{
   }
 
   private List<ConfigPlacement> mergeConfigs(List<ConfigPlacement> parentConfigs, List<ConfigPlacement> childConfigs) {
-    Map<String, ConfigPlacement> mergedConfigPlacements = new LinkedHashMap<String, ConfigPlacement>();
+    Map<String, ConfigPlacement> mergedConfigPlacements = new LinkedHashMap<>();
     for (ConfigPlacement parentConfigPlacement : parentConfigs) {
       mergedConfigPlacements.put(parentConfigPlacement.getConfig(), parentConfigPlacement);
     }
@@ -83,6 +83,6 @@ public class Placement{
         }
       }
     }
-    return new ArrayList<ConfigPlacement>(mergedConfigPlacements.values());
+    return new ArrayList<>(mergedConfigPlacements.values());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java
index f861148..43d2170 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java
@@ -161,7 +161,7 @@ public class Section {
 
   private List<Subsection> mergeSubsections(List<Subsection> parentSubsections, List<Subsection> childSubsections) {
 
-    Map<String, Subsection> mergedSubsections = new HashMap<String, Subsection>();
+    Map<String, Subsection> mergedSubsections = new HashMap<>();
     for (Subsection parentSubsection : parentSubsections) {
       mergedSubsections.put(parentSubsection.getName(), parentSubsection);
     }
@@ -177,7 +177,7 @@ public class Section {
         }
       }
     }
-    return new ArrayList<Subsection>(mergedSubsections.values());
+    return new ArrayList<>(mergedSubsections.values());
 
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
index 98222de..f7d4187 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java
@@ -80,7 +80,7 @@ public class TabLayout {
   }
 
   private List<Section> mergedSections(List<Section> parentSections, List<Section> childSections) {
-    Map<String, Section> mergedSections = new HashMap<String, Section>();
+    Map<String, Section> mergedSections = new HashMap<>();
     for (Section parentSection : parentSections) {
       mergedSections.put(parentSection.getName(), parentSection);
     }
@@ -100,7 +100,7 @@ public class TabLayout {
         }
       }
     }
-    return new ArrayList<Section>(mergedSections.values());
+    return new ArrayList<>(mergedSections.values());
 
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java
index f519f8c..58fe942 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java
@@ -90,7 +90,7 @@ public class ThemeConfiguration{
   }
 
   private List<Layout> mergeLayouts(List<Layout> parentLayouts, List<Layout> childLayouts) {
-    Map<String, Layout> mergedLayouts = new LinkedHashMap<String, Layout>();
+    Map<String, Layout> mergedLayouts = new LinkedHashMap<>();
 
     for (Layout parentLayout : parentLayouts) {
       mergedLayouts.put(parentLayout.getName(), parentLayout);
@@ -108,12 +108,12 @@ public class ThemeConfiguration{
       }
     }
 
-    return new ArrayList<Layout>(mergedLayouts.values());
+    return new ArrayList<>(mergedLayouts.values());
 
   }
 
   private List<WidgetEntry> mergeWidgets(List<WidgetEntry> parentWidgets, List<WidgetEntry> childWidgets) {
-    Map<String, WidgetEntry> mergedWidgets = new LinkedHashMap<String, WidgetEntry>();
+    Map<String, WidgetEntry> mergedWidgets = new LinkedHashMap<>();
     for (WidgetEntry widgetEntry : parentWidgets) {
       mergedWidgets.put(widgetEntry.getConfig(), widgetEntry);
     }
@@ -129,6 +129,6 @@ public class ThemeConfiguration{
 
     }
 
-    return new ArrayList<WidgetEntry>(mergedWidgets.values());
+    return new ArrayList<>(mergedWidgets.values());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
index ce36208..6d12402 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
@@ -205,8 +205,8 @@ public class AmbariContext {
     } catch (AmbariException e) {
       throw new RuntimeException("Failed to persist service and component resources: " + e, e);
     }
-    Set<ServiceRequest> serviceRequests = new HashSet<ServiceRequest>();
-    Set<ServiceComponentRequest> componentRequests = new HashSet<ServiceComponentRequest>();
+    Set<ServiceRequest> serviceRequests = new HashSet<>();
+    Set<ServiceComponentRequest> componentRequests = new HashSet<>();
     for (String service : services) {
       String credentialStoreEnabled = topology.getBlueprint().getCredentialStoreEnabled(service);
       serviceRequests.add(new ServiceRequest(clusterName, service, null, credentialStoreEnabled));
@@ -223,14 +223,14 @@ public class AmbariContext {
     }
     // set all services state to INSTALLED->STARTED
     // this is required so the user can start failed services at the service level
-    Map<String, Object> installProps = new HashMap<String, Object>();
+    Map<String, Object> installProps = new HashMap<>();
     installProps.put(ServiceResourceProvider.SERVICE_SERVICE_STATE_PROPERTY_ID, "INSTALLED");
     installProps.put(ServiceResourceProvider.SERVICE_CLUSTER_NAME_PROPERTY_ID, clusterName);
-    Map<String, Object> startProps = new HashMap<String, Object>();
+    Map<String, Object> startProps = new HashMap<>();
     startProps.put(ServiceResourceProvider.SERVICE_SERVICE_STATE_PROPERTY_ID, "STARTED");
     startProps.put(ServiceResourceProvider.SERVICE_CLUSTER_NAME_PROPERTY_ID, clusterName);
-    Predicate predicate = new EqualsPredicate<String>(
-        ServiceResourceProvider.SERVICE_CLUSTER_NAME_PROPERTY_ID, clusterName);
+    Predicate predicate = new EqualsPredicate<>(
+      ServiceResourceProvider.SERVICE_CLUSTER_NAME_PROPERTY_ID, clusterName);
     try {
       getServiceResourceProvider().updateResources(
           new RequestImpl(null, Collections.singleton(installProps), null, null), predicate);
@@ -262,7 +262,7 @@ public class AmbariContext {
     }
     String clusterName = cluster.getClusterName();
 
-    Map<String, Object> properties = new HashMap<String, Object>();
+    Map<String, Object> properties = new HashMap<>();
     properties.put(HostResourceProvider.HOST_CLUSTER_NAME_PROPERTY_ID, clusterName);
     properties.put(HostResourceProvider.HOST_NAME_PROPERTY_ID, hostName);
     properties.put(HostResourceProvider.HOST_RACK_INFO_PROPERTY_ID, host.getRackInfo());
@@ -275,7 +275,7 @@ public class AmbariContext {
           hostName, e.toString()), e);
     }
 
-    final Set<ServiceComponentHostRequest> requests = new HashSet<ServiceComponentHostRequest>();
+    final Set<ServiceComponentHostRequest> requests = new HashSet<>();
 
     for (Map.Entry<String, Collection<String>> entry : components.entrySet()) {
       String service = entry.getKey();
@@ -586,7 +586,7 @@ public class AmbariContext {
    * and the hosts associated with the host group are assigned to the config group.
    */
   private void createConfigGroupsAndRegisterHost(ClusterTopology topology, String groupName) throws AmbariException {
-    Map<String, Map<String, Config>> groupConfigs = new HashMap<String, Map<String, Config>>();
+    Map<String, Map<String, Config>> groupConfigs = new HashMap<>();
     Stack stack = topology.getBlueprint().getStack();
 
     // get the host-group config with cluster creation template overrides
@@ -605,7 +605,7 @@ public class AmbariContext {
       //todo: attributes
       Map<String, Config> serviceConfigs = groupConfigs.get(service);
       if (serviceConfigs == null) {
-        serviceConfigs = new HashMap<String, Config>();
+        serviceConfigs = new HashMap<>();
         groupConfigs.put(service, serviceConfigs);
       }
       serviceConfigs.put(type, config);


Mime
View raw message