ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adorosz...@apache.org
Subject [26/32] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
Date Wed, 29 Mar 2017 12:43:22 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index f2fd9ac..92e72ed 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -215,11 +215,11 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
   @Override
   public Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws
       SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-    final Set<Resource> resources = new HashSet<Resource>();
+    final Set<Resource> resources = new HashSet<>();
     final Set<String> requestedIds = getRequestPropertyIds(request, predicate);
     final Set<Map<String, Object>> propertyMaps = getPropertyMaps(predicate);
 
-    List<ClusterVersionEntity> requestedEntities = new ArrayList<ClusterVersionEntity>();
+    List<ClusterVersionEntity> requestedEntities = new ArrayList<>();
     for (Map<String, Object> propertyMap: propertyMaps) {
       final String clusterName = propertyMap.get(CLUSTER_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID).toString();
       final Long id;
@@ -243,7 +243,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
     for (ClusterVersionEntity entity: requestedEntities) {
       final Resource resource = new ResourceImpl(Resource.Type.ClusterStackVersion);
 
-      final Map<String, List<String>> hostStates = new HashMap<String, List<String>>();
+      final Map<String, List<String>> hostStates = new HashMap<>();
       for (RepositoryVersionState state: RepositoryVersionState.values()) {
         hostStates.put(state.name(), new ArrayList<String>());
       }
@@ -299,7 +299,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
 
     Map<String, Object> propertyMap = iterator.next();
 
-    Set<String> requiredProperties = new HashSet<String>();
+    Set<String> requiredProperties = new HashSet<>();
     requiredProperties.add(CLUSTER_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
     requiredProperties.add(CLUSTER_STACK_VERSION_REPOSITORY_VERSION_PROPERTY_ID);
     requiredProperties.add(CLUSTER_STACK_VERSION_STACK_PROPERTY_ID);
@@ -490,7 +490,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
 
     // build the list of OS repos
     List<OperatingSystemEntity> operatingSystems = repoVersionEnt.getOperatingSystems();
-    Map<String, List<RepositoryEntity>> perOsRepos = new HashMap<String, List<RepositoryEntity>>();
+    Map<String, List<RepositoryEntity>> perOsRepos = new HashMap<>();
     for (OperatingSystemEntity operatingSystem : operatingSystems) {
 
       if (operatingSystem.isAmbariManagedRepos()) {
@@ -503,7 +503,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
     RequestStageContainer req = createRequest();
 
     Iterator<Host> hostIterator = hosts.iterator();
-    Map<String, String> hostLevelParams = new HashMap<String, String>();
+    Map<String, String> hostLevelParams = new HashMap<>();
     hostLevelParams.put(JDK_LOCATION, getManagementController().getJdkResourceUrl());
     String hostParamsJson = StageUtils.getGson().toJson(hostLevelParams);
 
@@ -534,7 +534,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
 
     boolean hasStage = false;
 
-    ArrayList<Stage> stages = new ArrayList<Stage>(batchCount);
+    ArrayList<Stage> stages = new ArrayList<>(batchCount);
     for (int batchId = 1; batchId <= batchCount; batchId++) {
       // Create next stage
       String stageName;
@@ -612,8 +612,8 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
 
 
     // determine packages for all services that are installed on host
-    List<ServiceOsSpecific.Package> packages = new ArrayList<ServiceOsSpecific.Package>();
-    Set<String> servicesOnHost = new HashSet<String>();
+    List<ServiceOsSpecific.Package> packages = new ArrayList<>();
+    Set<String> servicesOnHost = new HashSet<>();
     List<ServiceComponentHost> components = cluster.getServiceComponentHosts(host.getHostName());
     for (ServiceComponentHost component : components) {
       if (repoServices.isEmpty() || repoServices.contains(component.getServiceName())) {
@@ -664,7 +664,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
     final String packageList = gson.toJson(packages);
     final String repoList = gson.toJson(repoInfo);
 
-    Map<String, String> params = new HashMap<String, String>();
+    Map<String, String> params = new HashMap<>();
     params.put("stack_id", stackId.getStackId());
     params.put("repository_version", repoVersion.getVersion());
     params.put("base_urls", repoList);
@@ -781,7 +781,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
       }
       Map<String, Object> propertyMap = iterator.next();
 
-      Set<String> requiredProperties = new HashSet<String>();
+      Set<String> requiredProperties = new HashSet<>();
       requiredProperties.add(CLUSTER_STACK_VERSION_CLUSTER_NAME_PROPERTY_ID);
       requiredProperties.add(CLUSTER_STACK_VERSION_REPOSITORY_VERSION_PROPERTY_ID);
       requiredProperties.add(CLUSTER_STACK_VERSION_STATE_PROPERTY_ID);
@@ -820,7 +820,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
       }
 
       if (!force) {
-        Map<String, String> args = new HashMap<String, String>();
+        Map<String, String> args = new HashMap<>();
         if (newStateStr.equals(RepositoryVersionState.CURRENT.toString())) {
           // Finalize upgrade workflow
           args.put(FinalizeUpgradeAction.UPGRADE_DIRECTION_KEY, "upgrade");
@@ -835,7 +835,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
 
         // Get a host name to populate the hostrolecommand table's hostEntity.
         String defaultHostName;
-        ArrayList<Host> hosts = new ArrayList<Host>(cluster.getHosts());
+        ArrayList<Host> hosts = new ArrayList<>(cluster.getHosts());
         if (!hosts.isEmpty()) {
           Collections.sort(hosts);
           defaultHostName = hosts.get(0).getHostName();

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
index 9303dcc..98b91b3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CompatibleRepositoryVersionResourceProvider.java
@@ -115,7 +115,7 @@ public class CompatibleRepositoryVersionResourceProvider extends ReadOnlyResourc
   @Override
   public Set<Resource> getResources(Request request, Predicate predicate)
     throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-    final Set<Resource> resources = new HashSet<Resource>();
+    final Set<Resource> resources = new HashSet<>();
     final Set<String> requestedIds = getRequestPropertyIds(request, predicate);
     final Set<Map<String, Object>> propertyMaps = getPropertyMaps(predicate);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 9d98fb6..cf6b717 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -96,8 +96,8 @@ public class ConfigGroupResourceProvider extends
   public static final String CONFIGGROUP_CONFIGS_PROPERTY_ID =
     PropertyHelper.getPropertyId("ConfigGroup", "desired_configs");
 
-  private static Set<String> pkPropertyIds = new HashSet<String>(Arrays
-    .asList(new String[] { CONFIGGROUP_ID_PROPERTY_ID }));
+  private static Set<String> pkPropertyIds = new HashSet<>(Arrays
+    .asList(new String[]{CONFIGGROUP_ID_PROPERTY_ID}));
 
   @Inject
   private static HostDAO hostDAO;
@@ -143,7 +143,7 @@ public class ConfigGroupResourceProvider extends
        SystemException, UnsupportedPropertyException,
        ResourceAlreadyExistsException, NoSuchParentResourceException {
 
-    final Set<ConfigGroupRequest> requests = new HashSet<ConfigGroupRequest>();
+    final Set<ConfigGroupRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : request.getProperties()) {
       requests.add(getConfigGroupRequest(propertyMap));
     }
@@ -157,7 +157,7 @@ public class ConfigGroupResourceProvider extends
        SystemException, UnsupportedPropertyException, NoSuchResourceException,
        NoSuchParentResourceException {
 
-    final Set<ConfigGroupRequest> requests = new HashSet<ConfigGroupRequest>();
+    final Set<ConfigGroupRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       requests.add(getConfigGroupRequest(propertyMap));
     }
@@ -170,7 +170,7 @@ public class ConfigGroupResourceProvider extends
     });
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources    = new HashSet<Resource>();
+    Set<Resource> resources    = new HashSet<>();
 
     if (requestedIds.contains(CONFIGGROUP_HOSTS_HOSTNAME_PROPERTY_ID)) {
       requestedIds.add(CONFIGGROUP_HOSTS_PROPERTY_ID);
@@ -205,7 +205,7 @@ public class ConfigGroupResourceProvider extends
        SystemException, UnsupportedPropertyException,
        NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ConfigGroupRequest> requests = new HashSet<ConfigGroupRequest>();
+    final Set<ConfigGroupRequest> requests = new HashSet<>();
 
     Iterator<Map<String,Object>> iterator = request.getProperties().iterator();
     if (iterator.hasNext()) {
@@ -281,7 +281,7 @@ public class ConfigGroupResourceProvider extends
           }
         });
 
-    Set<Resource> associatedResources = new HashSet<Resource>();
+    Set<Resource> associatedResources = new HashSet<>();
     for (ConfigGroupResponse response : responses) {
       Resource resource = new ResourceImpl(Resource.Type.ConfigGroup);
       resource.setProperty(CONFIGGROUP_ID_PROPERTY_ID, response.getId());
@@ -310,7 +310,7 @@ public class ConfigGroupResourceProvider extends
 
   private synchronized  Set<ConfigGroupResponse> getConfigGroups
     (Set<ConfigGroupRequest> requests) throws AmbariException {
-    Set<ConfigGroupResponse> responses = new HashSet<ConfigGroupResponse>();
+    Set<ConfigGroupResponse> responses = new HashSet<>();
     if (requests != null) {
       for (ConfigGroupRequest request : requests) {
         LOG.debug("Received a Config group request with"
@@ -377,8 +377,8 @@ public class ConfigGroupResourceProvider extends
             // Has tag
             if (configGroup.getTag().equals(request.getTag())) {
               // Has a match with hosts
-              List<Long> groupHostIds = new ArrayList<Long>(configGroup.getHosts().keySet());
-              Set<String> groupHostNames = new HashSet<String>(hostDAO.getHostNamesByHostIds(groupHostIds));
+              List<Long> groupHostIds = new ArrayList<>(configGroup.getHosts().keySet());
+              Set<String> groupHostNames = new HashSet<>(hostDAO.getHostNamesByHostIds(groupHostIds));
 
               groupHostNames.retainAll(request.getHosts());
               if (!groupHostNames.isEmpty()) {
@@ -504,7 +504,7 @@ public class ConfigGroupResourceProvider extends
     }
 
     Set<ConfigGroupResponse> configGroupResponses = new
-      HashSet<ConfigGroupResponse>();
+      HashSet<>();
 
     Clusters clusters = getManagementController().getClusters();
     ConfigGroupFactory configGroupFactory = getManagementController()
@@ -537,7 +537,7 @@ public class ConfigGroupResourceProvider extends
       }
 
       // Find hosts
-      Map<Long, Host> hosts = new HashMap<Long, Host>();
+      Map<Long, Host> hosts = new HashMap<>();
       if (request.getHosts() != null && !request.getHosts().isEmpty()) {
         for (String hostname : request.getHosts()) {
           Host host = clusters.getHost(hostname);
@@ -664,7 +664,7 @@ public class ConfigGroupResourceProvider extends
       }
 
       // Update hosts
-      Map<Long, Host> hosts = new HashMap<Long, Host>();
+      Map<Long, Host> hosts = new HashMap<>();
       if (request.getHosts() != null && !request.getHosts().isEmpty()) {
         for (String hostname : request.getHosts()) {
           Host host = clusters.getHost(hostname);
@@ -720,8 +720,8 @@ public class ConfigGroupResourceProvider extends
 
     request.setServiceConfigVersionNote((String) properties.get(CONFIGGROUP_SCV_NOTE_ID));
 
-    Map<String, Config> configurations = new HashMap<String, Config>();
-    Set<String> hosts = new HashSet<String>();
+    Map<String, Config> configurations = new HashMap<>();
+    Set<String> hosts = new HashSet<>();
 
     String hostnameKey = CONFIGGROUP_HOSTNAME_PROPERTY_ID;
     Object hostObj = properties.get(CONFIGGROUP_HOSTS_PROPERTY_ID);
@@ -759,8 +759,8 @@ public class ConfigGroupResourceProvider extends
           String tag = (String) configMap.get(ConfigurationResourceProvider
             .CONFIGURATION_CONFIG_TAG_PROPERTY_ID);
 
-          Map<String, String> configProperties = new HashMap<String, String>();
-          Map<String, Map<String, String>> configAttributes = new HashMap<String, Map<String, String>>();
+          Map<String, String> configProperties = new HashMap<>();
+          Map<String, Map<String, String>> configAttributes = new HashMap<>();
 
           for (Map.Entry<String, Object> entry : configMap.entrySet()) {
             String propertyCategory = PropertyHelper.getPropertyCategory(entry.getKey());

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
index 7c8e49e..11e9bac 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationResourceProvider.java
@@ -66,12 +66,12 @@ public class ConfigurationResourceProvider extends
   /**
    * The property ids for a configuration resource.
    */
-  private static final Set<String> PROPERTY_IDS = new HashSet<String>();
+  private static final Set<String> PROPERTY_IDS = new HashSet<>();
 
   /**
    * The key property ids for a configuration resource.
    */
-  private static final Map<Resource.Type, String> KEY_PROPERTY_IDS = new HashMap<Resource.Type, String>();
+  private static final Map<Resource.Type, String> KEY_PROPERTY_IDS = new HashMap<>();
 
   static {
     // properties
@@ -90,9 +90,9 @@ public class ConfigurationResourceProvider extends
    * The primary key property ids for the configuration resource type.
    */
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          CONFIGURATION_CLUSTER_NAME_PROPERTY_ID,
-          CONFIGURATION_CONFIG_TYPE_PROPERTY_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      CONFIGURATION_CLUSTER_NAME_PROPERTY_ID,
+      CONFIGURATION_CONFIG_TYPE_PROPERTY_ID}));
 
 
   // ----- Constructors ------------------------------------------------------
@@ -127,7 +127,7 @@ public class ConfigurationResourceProvider extends
       String type = (String) map.get(CONFIGURATION_CONFIG_TYPE_PROPERTY_ID);
       String tag  = (String) map.get(CONFIGURATION_CONFIG_TAG_PROPERTY_ID);
 
-      Map<String, String> configMap = new HashMap<String, String>();
+      Map<String, String> configMap = new HashMap<>();
       Map<String, Map<String, String>> configAttributesMap = null;
 
       for (Entry<String, Object> entry : map.entrySet()) {
@@ -139,12 +139,12 @@ public class ConfigurationResourceProvider extends
             && PROPERTIES_ATTRIBUTES_PATTERN.matcher(propertyCategory).matches()
             && null != entry.getValue()) {
           if (null == configAttributesMap) {
-            configAttributesMap = new HashMap<String, Map<String,String>>();
+            configAttributesMap = new HashMap<>();
           }
           String attributeName = propertyCategory.substring(propertyCategory.lastIndexOf('/') + 1);
           Map<String, String> attributesMap = configAttributesMap.get(attributeName);
           if (attributesMap == null) {
-            attributesMap = new HashMap<String, String>();
+            attributesMap = new HashMap<>();
             configAttributesMap.put(attributeName, attributesMap);
           }
           attributesMap.put(PropertyHelper.getPropertyName(entry.getKey()), entry.getValue().toString());
@@ -169,7 +169,7 @@ public class ConfigurationResourceProvider extends
   public Set<Resource> getResourcesAuthorized(Request request, Predicate predicate)
     throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ConfigurationRequest> requests = new HashSet<ConfigurationRequest>();
+    final Set<ConfigurationRequest> requests = new HashSet<>();
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       requests.add(getRequest(request, propertyMap));
@@ -182,7 +182,7 @@ public class ConfigurationResourceProvider extends
       }
     });
 
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
     for (ConfigurationResponse response : responses) {
       // don't use the StackId object here; we just want the stack ID string
       String stackId = response.getStackId().getStackId();
@@ -239,7 +239,7 @@ public class ConfigurationResourceProvider extends
     if (propertyIds.isEmpty()) {
       return propertyIds;
     }
-    Set<String> unsupportedProperties = new HashSet<String>();
+    Set<String> unsupportedProperties = new HashSet<>();
 
     for (String propertyId : propertyIds) {
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
index 7c94b82..79254c6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
@@ -70,12 +70,12 @@ public class CredentialResourceProvider extends AbstractControllerResourceProvid
 
   static {
     Set<String> set;
-    set = new HashSet<String>();
+    set = new HashSet<>();
     set.add(CREDENTIAL_CLUSTER_NAME_PROPERTY_ID);
     set.add(CREDENTIAL_ALIAS_PROPERTY_ID);
     PK_PROPERTY_IDS = Collections.unmodifiableSet(set);
 
-    set = new HashSet<String>();
+    set = new HashSet<>();
     set.add(CREDENTIAL_CLUSTER_NAME_PROPERTY_ID);
     set.add(CREDENTIAL_ALIAS_PROPERTY_ID);
     set.add(CREDENTIAL_PRINCIPAL_PROPERTY_ID);
@@ -83,7 +83,7 @@ public class CredentialResourceProvider extends AbstractControllerResourceProvid
     set.add(CREDENTIAL_TYPE_PROPERTY_ID);
     PROPERTY_IDS = Collections.unmodifiableSet(set);
 
-    HashMap<Type, String> map = new HashMap<Type, String>();
+    HashMap<Type, String> map = new HashMap<>();
     map.put(Type.Cluster, CREDENTIAL_CLUSTER_NAME_PROPERTY_ID);
     map.put(Type.Credential, CREDENTIAL_ALIAS_PROPERTY_ID);
     KEY_PROPERTY_IDS = Collections.unmodifiableMap(map);
@@ -130,7 +130,7 @@ public class CredentialResourceProvider extends AbstractControllerResourceProvid
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
     Set<String> requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
     boolean sendNotFoundErrorIfEmpty = false;
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
@@ -398,7 +398,7 @@ public class CredentialResourceProvider extends AbstractControllerResourceProvid
       if (credential instanceof PrincipalKeyCredential) {
         PrincipalKeyCredential principalKeyCredential = (PrincipalKeyCredential) credential;
 
-        Map<String, Object> credentialProperties = new HashMap<String, Object>();
+        Map<String, Object> credentialProperties = new HashMap<>();
 
         // Make sure the credential to update is removed from the persisted or temporary store... the
         // updated data may change the persistence type.

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
index cde04bc..f24c138 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
@@ -64,7 +64,7 @@ public class ExportBlueprintRequest implements TopologyRequest {
   private Blueprint blueprint;
   private Configuration configuration;
   //todo: Should this map be represented by a new class?
-  private Map<String, HostGroupInfo> hostGroupInfo = new HashMap<String, HostGroupInfo>();
+  private Map<String, HostGroupInfo> hostGroupInfo = new HashMap<>();
 
 
   public ExportBlueprintRequest(TreeNode<Resource> clusterNode) throws InvalidTopologyTemplateException {
@@ -129,11 +129,11 @@ public class ExportBlueprintRequest implements TopologyRequest {
   private void createBlueprint(Collection<ExportedHostGroup> exportedHostGroups, Stack stack) {
     String bpName = "exported-blueprint";
 
-    Collection<HostGroup> hostGroups = new ArrayList<HostGroup>();
+    Collection<HostGroup> hostGroups = new ArrayList<>();
     for (ExportedHostGroup exportedHostGroup : exportedHostGroups) {
 
       // create Component using component name
-      List<Component> componentList = new ArrayList<Component>();
+      List<Component> componentList = new ArrayList<>();
       for (String component : exportedHostGroup.getComponents()) {
         componentList.add(new Component(component));
       }
@@ -175,8 +175,8 @@ public class ExportBlueprintRequest implements TopologyRequest {
    */
   private void createConfiguration(TreeNode<Resource> clusterNode) {
 
-    Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
-    Map<String, Map<String, Map<String, String>>> attributes = new HashMap<String, Map<String, Map<String, String>>>();
+    Map<String, Map<String, String>> properties = new HashMap<>();
+    Map<String, Map<String, Map<String, String>>> attributes = new HashMap<>();
 
     Map<String, Object> desiredConfigMap = clusterNode.getObject().getPropertiesMap().get("Clusters/desired_configs");
     TreeNode<Resource> configNode = clusterNode.getChild("configurations");
@@ -204,7 +204,7 @@ public class ExportBlueprintRequest implements TopologyRequest {
    * @return collection of host groups
    */
   private Collection<ExportedHostGroup> processHostGroups(TreeNode<Resource> hostNode) {
-    Map<ExportedHostGroup, ExportedHostGroup> mapHostGroups = new HashMap<ExportedHostGroup, ExportedHostGroup>();
+    Map<ExportedHostGroup, ExportedHostGroup> mapHostGroups = new HashMap<>();
     int count = 1;
     for (TreeNode<Resource> host : hostNode.getChildren()) {
       ExportedHostGroup group = new ExportedHostGroup(host);
@@ -235,9 +235,9 @@ public class ExportBlueprintRequest implements TopologyRequest {
    * @return list of component names for the host
    */
   private List<Map<String, String>> processHostGroupComponents(ExportedHostGroup group) {
-    List<Map<String, String>> listHostGroupComponents = new ArrayList<Map<String, String>>();
+    List<Map<String, String>> listHostGroupComponents = new ArrayList<>();
     for (String component : group.getComponents()) {
-      Map<String, String> mapComponentProperties = new HashMap<String, String>();
+      Map<String, String> mapComponentProperties = new HashMap<>();
       listHostGroupComponents.add(mapComponentProperties);
       mapComponentProperties.put("name", component);
     }
@@ -261,12 +261,12 @@ public class ExportBlueprintRequest implements TopologyRequest {
     /**
      * Associated components.
      */
-    private Set<String> components = new HashSet<String>();
+    private Set<String> components = new HashSet<>();
 
     /**
      * Host group scoped configurations.
      */
-    private Collection<ExportedConfiguration> configurations = new HashSet<ExportedConfiguration>();
+    private Collection<ExportedConfiguration> configurations = new HashSet<>();
 
     /**
      * Number of instances.
@@ -276,7 +276,7 @@ public class ExportBlueprintRequest implements TopologyRequest {
     /**
      * Collection of associated hosts.
      */
-    private Collection<String> hosts = new HashSet<String>();
+    private Collection<String> hosts = new HashSet<>();
 
     /**
      * Constructor.
@@ -296,8 +296,8 @@ public class ExportBlueprintRequest implements TopologyRequest {
     }
 
     public Configuration getConfiguration() {
-      Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>();
-      Map<String, Map<String, Map<String, String>>> configAttributes = new HashMap<String, Map<String, Map<String, String>>>();
+      Map<String, Map<String, String>> configProperties = new HashMap<>();
+      Map<String, Map<String, Map<String, String>>> configAttributes = new HashMap<>();
 
       for (ExportedConfiguration config : configurations) {
         configProperties.put(config.getType(), config.getProperties());
@@ -450,12 +450,12 @@ public class ExportBlueprintRequest implements TopologyRequest {
     /**
      * Properties of the configuration.
      */
-    private Map<String, String> properties = new HashMap<String, String>();
+    private Map<String, String> properties = new HashMap<>();
 
     /**
      * Attributes for the properties in the cluster configuration.
      */
-    private Map<String, Map<String, String>> propertyAttributes = new HashMap<String, Map<String, String>>();
+    private Map<String, Map<String, String>> propertyAttributes = new HashMap<>();
 
     /**
      * Constructor.

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Extension.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Extension.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Extension.java
index a458b17..bbfef30 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Extension.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Extension.java
@@ -55,24 +55,24 @@ public class Extension {
    * Map of service name to components
    */
   private Map<String, Collection<String>> serviceComponents =
-      new HashMap<String, Collection<String>>();
+    new HashMap<>();
 
   /**
    * Map of component to service
    */
-  private Map<String, String> componentService = new HashMap<String, String>();
+  private Map<String, String> componentService = new HashMap<>();
 
   /**
    * Map of component to dependencies
    */
   private Map<String, Collection<DependencyInfo>> dependencies =
-      new HashMap<String, Collection<DependencyInfo>>();
+    new HashMap<>();
 
   /**
    * Map of dependency to conditional service
    */
   private Map<DependencyInfo, String> dependencyConditionalServiceMap =
-      new HashMap<DependencyInfo, String>();
+    new HashMap<>();
 
   /**
    * Map of database component name to configuration property which indicates whether
@@ -80,18 +80,18 @@ public class Extension {
    * If the value of the config property starts with 'New', the database is determined
    * to be managed, otherwise it is non-managed.
    */
-  private Map<String, String> dbDependencyInfo = new HashMap<String, String>();
+  private Map<String, String> dbDependencyInfo = new HashMap<>();
 
   /**
    * Map of component to required cardinality
    */
-  private Map<String, String> cardinalityRequirements = new HashMap<String, String>();
+  private Map<String, String> cardinalityRequirements = new HashMap<>();
 
   /**
    * Map of component to auto-deploy information
    */
   private Map<String, AutoDeployInfo> componentAutoDeployInfo =
-      new HashMap<String, AutoDeployInfo>();
+    new HashMap<>();
 
   /**
    * Ambari Management Controller, used to obtain Extension definitions
@@ -177,9 +177,9 @@ public class Extension {
    * @return map of service to associated components
    */
   public Map<String, Collection<String>> getComponents() {
-    Map<String, Collection<String>> serviceComponents = new HashMap<String, Collection<String>>();
+    Map<String, Collection<String>> serviceComponents = new HashMap<>();
     for (String service : getServices()) {
-      Collection<String> components = new HashSet<String>();
+      Collection<String> components = new HashSet<>();
       components.addAll(getComponents(service));
       serviceComponents.put(service, components);
     }
@@ -227,7 +227,7 @@ public class Extension {
    * @return collection of services which contain the specified components
    */
   public Collection<String> getServicesForComponents(Collection<String> components) {
-    Set<String> services = new HashSet<String>();
+    Set<String> services = new HashSet<>();
     for (String component : components) {
       services.add(getServiceForComponent(component));
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
index 7523fff..fef69ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
@@ -68,8 +68,8 @@ public class ExtensionLinkResourceProvider extends AbstractControllerResourcePro
   public static final String EXTENSION_VERSION_PROPERTY_ID = PropertyHelper
       .getPropertyId("ExtensionLink", "extension_version");
 
-  private static Set<String> pkPropertyIds = new HashSet<String>(
-      Arrays.asList(new String[] { LINK_ID_PROPERTY_ID, STACK_NAME_PROPERTY_ID, STACK_VERSION_PROPERTY_ID, EXTENSION_NAME_PROPERTY_ID, EXTENSION_VERSION_PROPERTY_ID }));
+  private static Set<String> pkPropertyIds = new HashSet<>(
+    Arrays.asList(new String[]{LINK_ID_PROPERTY_ID, STACK_NAME_PROPERTY_ID, STACK_VERSION_PROPERTY_ID, EXTENSION_NAME_PROPERTY_ID, EXTENSION_VERSION_PROPERTY_ID}));
 
   @Inject
   private static ExtensionLinkDAO dao;
@@ -85,7 +85,7 @@ public class ExtensionLinkResourceProvider extends AbstractControllerResourcePro
 	        throws SystemException, UnsupportedPropertyException,
 	        NoSuchParentResourceException, ResourceAlreadyExistsException {
 
-    final Set<ExtensionLinkRequest> requests = new HashSet<ExtensionLinkRequest>();
+    final Set<ExtensionLinkRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : request.getProperties()) {
       requests.add(getRequest(propertyMap));
     }
@@ -118,7 +118,7 @@ public class ExtensionLinkResourceProvider extends AbstractControllerResourcePro
         throws SystemException, UnsupportedPropertyException,
         NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ExtensionLinkRequest> requests = new HashSet<ExtensionLinkRequest>();
+    final Set<ExtensionLinkRequest> requests = new HashSet<>();
     if (predicate == null) {
       requests.add(getRequest(Collections.<String, Object>emptyMap()));
     } else {
@@ -154,10 +154,10 @@ public class ExtensionLinkResourceProvider extends AbstractControllerResourcePro
         throws SystemException, UnsupportedPropertyException,
         NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<Resource> resources = new HashSet<Resource>();
+    final Set<Resource> resources = new HashSet<>();
     final Set<String> requestedIds = getRequestPropertyIds(request, predicate);
 
-    final Set<ExtensionLinkRequest> requests = new HashSet<ExtensionLinkRequest>();
+    final Set<ExtensionLinkRequest> requests = new HashSet<>();
     if (predicate == null) {
       requests.add(getRequest(Collections.<String, Object>emptyMap()));
     } else {
@@ -166,7 +166,7 @@ public class ExtensionLinkResourceProvider extends AbstractControllerResourcePro
       }
     }
 
-    Set<ExtensionLinkEntity> entities = new HashSet<ExtensionLinkEntity>();
+    Set<ExtensionLinkEntity> entities = new HashSet<>();
 
     for (ExtensionLinkRequest extensionLinkRequest : requests) {
       verifyStackAndExtensionExist(extensionLinkRequest);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionResourceProvider.java
index 5b495e9..8a2c58b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionResourceProvider.java
@@ -50,8 +50,8 @@ public class ExtensionResourceProvider extends ReadOnlyResourceProvider {
   public static final String EXTENSION_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("Extensions", "extension_name");
 
-  private static Set<String> pkPropertyIds = new HashSet<String>(
-      Arrays.asList(new String[] { EXTENSION_NAME_PROPERTY_ID }));
+  private static Set<String> pkPropertyIds = new HashSet<>(
+    Arrays.asList(new String[]{EXTENSION_NAME_PROPERTY_ID}));
 
   protected ExtensionResourceProvider(Set<String> propertyIds,
       Map<Type, String> keyPropertyIds,
@@ -65,7 +65,7 @@ public class ExtensionResourceProvider extends ReadOnlyResourceProvider {
       throws SystemException, UnsupportedPropertyException,
       NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ExtensionRequest> requests = new HashSet<ExtensionRequest>();
+    final Set<ExtensionRequest> requests = new HashSet<>();
 
     if (predicate == null) {
       requests.add(getRequest(Collections.<String, Object>emptyMap()));
@@ -84,7 +84,7 @@ public class ExtensionResourceProvider extends ReadOnlyResourceProvider {
       }
     });
 
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
 
     for (ExtensionResponse response : responses) {
       Resource resource = new ResourceImpl(Resource.Type.Extension);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionVersionResourceProvider.java
index d31ba82..23f4d73 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionVersionResourceProvider.java
@@ -54,8 +54,8 @@ public class ExtensionVersionResourceProvider extends ReadOnlyResourceProvider {
   public static final String EXTENSION_ERROR_SET      = PropertyHelper.getPropertyId("Versions", "extension-errors");
   public static final String EXTENSION_PARENT_PROPERTY_ID      = PropertyHelper.getPropertyId("Versions", "parent_extension_version");
 
-  private static Set<String> pkPropertyIds = new HashSet<String>(
-      Arrays.asList(new String[] { EXTENSION_NAME_PROPERTY_ID, EXTENSION_VERSION_PROPERTY_ID }));
+  private static Set<String> pkPropertyIds = new HashSet<>(
+    Arrays.asList(new String[]{EXTENSION_NAME_PROPERTY_ID, EXTENSION_VERSION_PROPERTY_ID}));
 
   protected ExtensionVersionResourceProvider(Set<String> propertyIds,
       Map<Type, String> keyPropertyIds,
@@ -68,7 +68,7 @@ public class ExtensionVersionResourceProvider extends ReadOnlyResourceProvider {
       throws SystemException, UnsupportedPropertyException,
       NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ExtensionVersionRequest> requests = new HashSet<ExtensionVersionRequest>();
+    final Set<ExtensionVersionRequest> requests = new HashSet<>();
 
     if (predicate == null) {
       requests.add(getRequest(Collections.<String, Object>emptyMap()));
@@ -87,7 +87,7 @@ public class ExtensionVersionResourceProvider extends ReadOnlyResourceProvider {
       }
     });
 
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
 
     for (ExtensionVersionResponse response : responses) {
       Resource resource = new ResourceImpl(Resource.Type.ExtensionVersion);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/FeedResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/FeedResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/FeedResourceProvider.java
index 17e786c..3eb4cb8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/FeedResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/FeedResourceProvider.java
@@ -63,8 +63,8 @@ public class FeedResourceProvider extends AbstractDRResourceProvider {
   protected static final String FEED_PROPERTIES_PROPERTY_ID = PropertyHelper.getPropertyId("Feed", "properties");
 
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          FEED_NAME_PROPERTY_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      FEED_NAME_PROPERTY_ID}));
 
   /**
    * Construct a provider.
@@ -101,7 +101,7 @@ public class FeedResourceProvider extends AbstractDRResourceProvider {
     IvoryService  service      = getService();
     List<String>  feedNames    = service.getFeedNames();
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources    = new HashSet<Resource>();
+    Set<Resource> resources    = new HashSet<>();
 
     for (String feedName : feedNames ) {
 
@@ -216,7 +216,7 @@ public class FeedResourceProvider extends AbstractDRResourceProvider {
    * @return a new feed
    */
   protected static Feed getFeed(String feedName, Map<String, Object> propertyMap) {
-    Map<String, String> properties = new HashMap<String, String>();
+    Map<String, String> properties = new HashMap<>();
     for ( Map.Entry<String, Object> entry : propertyMap.entrySet()) {
       String property = entry.getKey();
       String category = PropertyHelper.getPropertyCategory(property);
@@ -253,7 +253,7 @@ public class FeedResourceProvider extends AbstractDRResourceProvider {
    * @return the map of properies to use for the update
    */
   protected static Map<String, Object> getUpdateMap(Resource resource, Map<String, Object> propertyMap) {
-    Map<String, Object> updateMap = new HashMap<String, Object>();
+    Map<String, Object> updateMap = new HashMap<>();
 
     updateMap.put(FEED_NAME_PROPERTY_ID, resource.getPropertyValue(FEED_NAME_PROPERTY_ID));
     updateMap.put(FEED_DESCRIPTION_PROPERTY_ID, resource.getPropertyValue(FEED_DESCRIPTION_PROPERTY_ID));

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupPrivilegeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupPrivilegeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupPrivilegeResourceProvider.java
index bf63794..4140484 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupPrivilegeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupPrivilegeResourceProvider.java
@@ -94,7 +94,7 @@ public class GroupPrivilegeResourceProvider extends ReadOnlyResourceProvider {
   /**
    * The property ids for a privilege resource.
    */
-  private static Set<String> propertyIds = new HashSet<String>();
+  private static Set<String> propertyIds = new HashSet<>();
 
   static {
     propertyIds.add(PRIVILEGE_PRIVILEGE_ID_PROPERTY_ID);
@@ -135,7 +135,7 @@ public class GroupPrivilegeResourceProvider extends ReadOnlyResourceProvider {
   /**
    * The key property ids for a privilege resource.
    */
-  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<Resource.Type, String>();
+  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<>();
 
   static {
     keyPropertyIds.put(Resource.Type.Group, PRIVILEGE_GROUP_NAME_PROPERTY_ID);
@@ -167,7 +167,7 @@ public class GroupPrivilegeResourceProvider extends ReadOnlyResourceProvider {
   public Set<Resource> getResources(Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException,
       NoSuchResourceException, NoSuchParentResourceException {
-    final Set<Resource> resources = new HashSet<Resource>();
+    final Set<Resource> resources = new HashSet<>();
     final Set<String> requestedIds = getRequestPropertyIds(request, predicate);
 
     // Ensure that the authenticated user has authorization to get this information

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
index e07dece..f05e522 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/GroupResourceProvider.java
@@ -52,8 +52,8 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
   public static final String GROUP_GROUPTYPE_PROPERTY_ID  = PropertyHelper.getPropertyId("Groups", "group_type");
 
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          GROUP_GROUPNAME_PROPERTY_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      GROUP_GROUPNAME_PROPERTY_ID}));
 
   /**
    * Create a new resource provider for the given management controller.
@@ -80,7 +80,7 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
       UnsupportedPropertyException,
       ResourceAlreadyExistsException,
       NoSuchParentResourceException {
-    final Set<GroupRequest> requests = new HashSet<GroupRequest>();
+    final Set<GroupRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : request.getProperties()) {
       requests.add(getRequest(propertyMap));
     }
@@ -100,7 +100,7 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
   protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<GroupRequest> requests = new HashSet<GroupRequest>();
+    final Set<GroupRequest> requests = new HashSet<>();
 
     if (predicate == null) {
       requests.add(getRequest(null));
@@ -122,7 +122,7 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
         + responses.size());
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources    = new HashSet<Resource>();
+    Set<Resource> resources    = new HashSet<>();
 
     for (GroupResponse groupResponse : responses) {
       ResourceImpl resource = new ResourceImpl(Resource.Type.Group);
@@ -145,7 +145,7 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
   @Override
   protected RequestStatus updateResourcesAuthorized(Request request, Predicate predicate)
     throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-    final Set<GroupRequest> requests = new HashSet<GroupRequest>();
+    final Set<GroupRequest> requests = new HashSet<>();
 
     for (Map<String, Object> propertyMap : getPropertyMaps(request.getProperties().iterator().next(), predicate)) {
       final GroupRequest req = getRequest(propertyMap);
@@ -166,7 +166,7 @@ public class GroupResourceProvider extends AbstractControllerResourceProvider {
   @Override
   protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
-    final Set<GroupRequest> requests = new HashSet<GroupRequest>();
+    final Set<GroupRequest> requests = new HashSet<>();
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       final GroupRequest req = getRequest(propertyMap);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
index 72a4bf0..3402693 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
@@ -56,8 +56,8 @@ public class HostComponentProcessResourceProvider extends ReadOnlyResourceProvid
 
   // Primary Key Fields
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          HC_PROCESS_CLUSTER_NAME_ID, HC_PROCESS_HOST_NAME_ID, HC_PROCESS_COMPONENT_NAME_ID, HC_PROCESS_NAME_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      HC_PROCESS_CLUSTER_NAME_ID, HC_PROCESS_HOST_NAME_ID, HC_PROCESS_COMPONENT_NAME_ID, HC_PROCESS_NAME_ID}));
 
   // ----- Constructors ----------------------------------------------------
 
@@ -97,7 +97,7 @@ public class HostComponentProcessResourceProvider extends ReadOnlyResourceProvid
       }
     });
     
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
     
     for (HostComponentProcessResponse response : responses) {
       Resource r = new ResourceImpl(Resource.Type.HostComponentProcess);
@@ -136,7 +136,7 @@ public class HostComponentProcessResourceProvider extends ReadOnlyResourceProvid
       Set<Map<String, Object>> requestMaps)
     throws AmbariException {
     
-    Set<HostComponentProcessResponse> results = new HashSet<HostComponentProcessResponse>();
+    Set<HostComponentProcessResponse> results = new HashSet<>();
     
     Clusters clusters = getManagementController().getClusters();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index c8ec08b..46e791b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -116,11 +116,11 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
   //Parameters from the predicate
   private static final String QUERY_PARAMETERS_RUN_SMOKE_TEST_ID = "params/run_smoke_test";
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID,
-          HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID,
-          HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID,
-          HOST_COMPONENT_HOST_NAME_PROPERTY_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID,
+      HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID,
+      HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID,
+      HOST_COMPONENT_HOST_NAME_PROPERTY_ID}));
 
   /**
    * maintenance state helper
@@ -160,7 +160,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
       ResourceAlreadyExistsException,
       NoSuchParentResourceException {
 
-    final Set<ServiceComponentHostRequest> requests = new HashSet<ServiceComponentHostRequest>();
+    final Set<ServiceComponentHostRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : request.getProperties()) {
       requests.add(changeRequest(propertyMap));
     }
@@ -182,7 +182,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
   public Set<Resource> getResources(Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ServiceComponentHostRequest> requests = new HashSet<ServiceComponentHostRequest>();
+    final Set<ServiceComponentHostRequest> requests = new HashSet<>();
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       requests.add(getRequest(propertyMap));
@@ -194,7 +194,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
   private Set<Resource> getResourcesForUpdate(Request request, Predicate predicate)
     throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<ServiceComponentHostRequest> requests = new HashSet<ServiceComponentHostRequest>();
+    final Set<ServiceComponentHostRequest> requests = new HashSet<>();
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       requests.add(getRequest(propertyMap));
@@ -207,7 +207,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
   private Set<Resource> findResources(Request request, final Predicate predicate,
                                       final Set<ServiceComponentHostRequest> requests)
           throws SystemException, NoSuchResourceException, NoSuchParentResourceException {
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
     Set<String> requestedIds = getRequestPropertyIds(request, predicate);
     // We always need host_name for sch
     requestedIds.add(HOST_COMPONENT_HOST_NAME_PROPERTY_ID);
@@ -322,7 +322,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
     if (propertyIds.isEmpty()) {
       return propertyIds;
     }
-    Set<String> unsupportedProperties = new HashSet<String>();
+    Set<String> unsupportedProperties = new HashSet<>();
 
     for (String propertyId : propertyIds) {
       if (!propertyId.equals("config")) {
@@ -341,7 +341,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
     RequestStageContainer requestStages;
     //for (String host : hosts) {
 
-    Map<String, Object> installProperties = new HashMap<String, Object>();
+    Map<String, Object> installProperties = new HashMap<>();
 
     installProperties.put(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, "INSTALLED");
     Map<String, String> requestInfo = new HashMap<>();
@@ -402,14 +402,14 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
 
     RequestStageContainer requestStages;
     try {
-      Map<String, Object> startProperties = new HashMap<String, Object>();
+      Map<String, Object> startProperties = new HashMap<>();
       startProperties.put(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, "STARTED");
       Request startRequest = PropertyHelper.getUpdateRequest(startProperties, requestInfo);
       // Important to query against desired_state as this has been updated when install stage was created
       // If I query against state, then the getRequest compares predicate prop against desired_state and then when the predicate
       // is later applied explicitly, it gets compared to live_state. Since live_state == INSTALLED == INIT at this point and
       // desired_state == INSTALLED, we will always get 0 matches since both comparisons can't be true :(
-      Predicate installedStatePredicate = new EqualsPredicate<String>(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, "INSTALLED");
+      Predicate installedStatePredicate = new EqualsPredicate<>(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, "INSTALLED");
       Predicate notClientPredicate = new NotPredicate(new ClientComponentPredicate());
       Predicate clusterAndClientPredicate = new AndPredicate(clusterPredicate, notClientPredicate);
       Predicate hostAndStatePredicate = new AndPredicate(installedStatePredicate, hostPredicate);
@@ -422,10 +422,10 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
       } else {
         // any INSTALL_ONLY components should not be started
         List<Predicate> listOfComponentPredicates =
-          new ArrayList<Predicate>();
+          new ArrayList<>();
 
         for (String installOnlyComponent : installOnlyComponents) {
-          Predicate componentNameEquals = new EqualsPredicate<String>(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, installOnlyComponent);
+          Predicate componentNameEquals = new EqualsPredicate<>(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, installOnlyComponent);
           // create predicate to filter out the install only component
           listOfComponentPredicates.add(new NotPredicate(componentNameEquals));
         }
@@ -482,11 +482,11 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
     Clusters clusters = getManagementController().getClusters();
 
 
-    Map<String, Map<State, List<ServiceComponentHost>>> changedScHosts = new HashMap<String, Map<State, List<ServiceComponentHost>>>();
-    Collection<ServiceComponentHost> ignoredScHosts = new ArrayList<ServiceComponentHost>();
-    Set<String> clusterNames = new HashSet<String>();
-    Map<String, Map<String, Map<String, Set<String>>>> requestClusters = new HashMap<String, Map<String, Map<String, Set<String>>>>();
-    Map<ServiceComponentHost, State> directTransitionScHosts = new HashMap<ServiceComponentHost, State>();
+    Map<String, Map<State, List<ServiceComponentHost>>> changedScHosts = new HashMap<>();
+    Collection<ServiceComponentHost> ignoredScHosts = new ArrayList<>();
+    Set<String> clusterNames = new HashSet<>();
+    Map<String, Map<String, Map<String, Set<String>>>> requestClusters = new HashMap<>();
+    Map<ServiceComponentHost, State> directTransitionScHosts = new HashMap<>();
 
     Resource.Type reqOpLvl = determineOperationLevel(requestProperties);
 
@@ -529,19 +529,19 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
       // maps of cluster->services, services->components, components->hosts
       Map<String, Map<String, Set<String>>> clusterServices = requestClusters.get(request.getClusterName());
       if (clusterServices == null) {
-        clusterServices = new HashMap<String, Map<String, Set<String>>>();
+        clusterServices = new HashMap<>();
         requestClusters.put(request.getClusterName(), clusterServices);
       }
 
       Map<String, Set<String>> serviceComponents = clusterServices.get(request.getServiceName());
       if (serviceComponents == null) {
-        serviceComponents = new HashMap<String, Set<String>>();
+        serviceComponents = new HashMap<>();
         clusterServices.put(request.getServiceName(), serviceComponents);
       }
 
       Set<String> componentHosts = serviceComponents.get(request.getComponentName());
       if (componentHosts == null) {
-        componentHosts = new HashSet<String>();
+        componentHosts = new HashSet<>();
         serviceComponents.put(request.getComponentName(), componentHosts) ;
       }
 
@@ -764,7 +764,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
                                                          NoSuchResourceException,
                                                          NoSuchParentResourceException {
 
-    final Set<ServiceComponentHostRequest> requests = new HashSet<ServiceComponentHostRequest>();
+    final Set<ServiceComponentHostRequest> requests = new HashSet<>();
 
     final boolean runSmokeTest = "true".equals(getQueryParameterValue(
         QUERY_PARAMETERS_RUN_SMOKE_TEST_ID, predicate));
@@ -782,7 +782,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
       //todo: and then this predicate evaluation should always be performed and the
       //todo: temporary performQueryEvaluation flag hack should be removed.
       if (! performQueryEvaluation || predicate.evaluate(queryResource)) {
-        Map<String, Object> updateRequestProperties = new HashMap<String, Object>();
+        Map<String, Object> updateRequestProperties = new HashMap<>();
 
         // add props from query resource
         updateRequestProperties.putAll(PropertyHelper.getProperties(queryResource));

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
index 118dcaa..bfaf7b4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
@@ -76,7 +76,7 @@ public class HostKerberosIdentityResourceProvider extends ReadOnlyResourceProvid
   );
 
   protected static final Set<String> PK_PROPERTY_IDS = Collections.unmodifiableSet(
-      new HashSet<String>(PK_PROPERTY_MAP.values())
+    new HashSet<>(PK_PROPERTY_MAP.values())
   );
 
   protected static final Set<String> PROPERTY_IDS = Collections.unmodifiableSet(
@@ -154,7 +154,7 @@ public class HostKerberosIdentityResourceProvider extends ReadOnlyResourceProvid
 
     @Override
     public Set<Resource> invoke() throws AmbariException {
-      Set<Resource> resources = new HashSet<Resource>();
+      Set<Resource> resources = new HashSet<>();
 
       for (Map<String, Object> propertyMap : propertyMaps) {
         String clusterName = (String) propertyMap.get(KERBEROS_IDENTITY_CLUSTER_NAME_PROPERTY_ID);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
index cae2f70..f604a7f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
@@ -155,8 +155,8 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
 
 
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          HOST_NAME_PROPERTY_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      HOST_NAME_PROPERTY_ID}));
 
   @Inject
   private MaintenanceStateHelper maintenanceStateHelper;
@@ -220,7 +220,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<HostRequest> requests = new HashSet<HostRequest>();
+    final Set<HostRequest> requests = new HashSet<>();
 
     if (predicate == null) {
       requests.add(getRequest(null));
@@ -239,7 +239,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     });
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources    = new HashSet<Resource>();
+    Set<Resource> resources    = new HashSet<>();
 
     for (HostResponse response : responses) {
       Resource resource = new ResourceImpl(Resource.Type.Host);
@@ -313,7 +313,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   protected RequestStatus updateResourcesAuthorized(final Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<HostRequest> requests = new HashSet<HostRequest>();
+    final Set<HostRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : getPropertyMaps(request.getProperties().iterator().next(), predicate)) {
       requests.add(getRequest(propertyMap));
     }
@@ -460,12 +460,12 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     AmbariManagementController controller = getManagementController();
     Clusters                   clusters   = controller.getClusters();
 
-    Set<String> duplicates = new HashSet<String>();
-    Set<String> unknowns = new HashSet<String>();
-    Set<String> allHosts = new HashSet<String>();
+    Set<String> duplicates = new HashSet<>();
+    Set<String> unknowns = new HashSet<>();
+    Set<String> allHosts = new HashSet<>();
 
 
-    Set<HostRequest> hostRequests = new HashSet<HostRequest>();
+    Set<HostRequest> hostRequests = new HashSet<>();
     for (Map<String, Object> propertyMap : propertySet) {
       HostRequest hostRequest = getRequest(propertyMap);
       hostRequests.add(hostRequest);
@@ -504,9 +504,9 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
           "These hosts have not been registered with the server: " + names.toString());
     }
 
-    Map<String, Set<String>> hostClustersMap = new HashMap<String, Set<String>>();
-    Map<String, Map<String, String>> hostAttributes = new HashMap<String, Map<String, String>>();
-    Set<String> allClusterSet = new HashSet<String>();
+    Map<String, Set<String>> hostClustersMap = new HashMap<>();
+    Map<String, Map<String, String>> hostAttributes = new HashMap<>();
+    Set<String> allClusterSet = new HashSet<>();
 
     for (HostRequest hostRequest : hostRequests) {
       if (hostRequest.getHostname() != null &&
@@ -514,7 +514,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
           hostRequest.getClusterName() != null &&
           !hostRequest.getClusterName().isEmpty()){
 
-        Set<String> clusterSet = new HashSet<String>();
+        Set<String> clusterSet = new HashSet<>();
         clusterSet.add(hostRequest.getClusterName());
         allClusterSet.add(hostRequest.getClusterName());
         hostClustersMap.put(hostRequest.getHostname(), clusterSet);
@@ -597,7 +597,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   }
 
   protected Set<HostResponse> getHosts(Set<HostRequest> requests) throws AmbariException {
-    Set<HostResponse> response = new HashSet<HostResponse>();
+    Set<HostResponse> response = new HashSet<>();
 
     AmbariManagementController controller = getManagementController();
 
@@ -622,7 +622,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     //TODO/FIXME what is the requirement for filtering on host attributes?
 
     List<Host> hosts;
-    Set<HostResponse> response = new HashSet<HostResponse>();
+    Set<HostResponse> response = new HashSet<>();
     Cluster           cluster  = null;
 
     Clusters                   clusters   = controller.getClusters();
@@ -642,7 +642,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
     if (hostName == null) {
       hosts = clusters.getHosts();
     } else {
-      hosts = new ArrayList<Host>();
+      hosts = new ArrayList<>();
       try {
         hosts.add(clusters.getHost(request.getHostname()));
       } catch (HostNotFoundException e) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
index 9ccefe0..7304a7c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
@@ -55,9 +55,9 @@ public class InstanceResourceProvider extends AbstractDRResourceProvider {
   protected static final String INSTANCE_LOG_PROPERTY_ID        = PropertyHelper.getPropertyId("Instance", "log");
 
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          INSTANCE_FEED_NAME_PROPERTY_ID,
-          INSTANCE_ID_PROPERTY_ID }));
+    new HashSet<>(Arrays.asList(new String[]{
+      INSTANCE_FEED_NAME_PROPERTY_ID,
+      INSTANCE_ID_PROPERTY_ID}));
 
   /**
    * Construct a provider.
@@ -84,8 +84,8 @@ public class InstanceResourceProvider extends AbstractDRResourceProvider {
       UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources    = new HashSet<Resource>();
-    List<String>  feedNames    = new LinkedList<String>();
+    Set<Resource> resources    = new HashSet<>();
+    List<String>  feedNames    = new LinkedList<>();
 
     IvoryService service = getService();
     if (predicate == null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
index 6235651..2c5741f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
@@ -81,9 +81,9 @@ public class JobResourceProvider extends
   protected static final String JOB_WORKFLOW_ENTITY_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("Job", "workflow_entity_name");
 
-  private static final Set<String> pkPropertyIds = new HashSet<String>(
-      Arrays.asList(new String[] {JOB_CLUSTER_NAME_PROPERTY_ID,
-          JOB_WORKFLOW_ID_PROPERTY_ID, JOB_ID_PROPERTY_ID}));
+  private static final Set<String> pkPropertyIds = new HashSet<>(
+    Arrays.asList(new String[]{JOB_CLUSTER_NAME_PROPERTY_ID,
+      JOB_WORKFLOW_ID_PROPERTY_ID, JOB_ID_PROPERTY_ID}));
 
   protected JobFetcher jobFetcher;
 
@@ -130,7 +130,7 @@ public class JobResourceProvider extends
       throws SystemException, UnsupportedPropertyException,
       NoSuchResourceException, NoSuchParentResourceException {
 
-    Set<Resource> resourceSet = new HashSet<Resource>();
+    Set<Resource> resourceSet = new HashSet<>();
     Set<String> requestedIds = getRequestPropertyIds(request, predicate);
 
     Set<Map<String,Object>> predicatePropertieSet = getPropertyMaps(predicate);
@@ -167,7 +167,7 @@ public class JobResourceProvider extends
 
   @Override
   public Map<Type,String> getKeyPropertyIds() {
-    Map<Type,String> keyPropertyIds = new HashMap<Type,String>();
+    Map<Type,String> keyPropertyIds = new HashMap<>();
     keyPropertyIds.put(Type.Cluster, JOB_CLUSTER_NAME_PROPERTY_ID);
     keyPropertyIds.put(Type.Workflow, JOB_WORKFLOW_ID_PROPERTY_ID);
     keyPropertyIds.put(Type.Job, JOB_ID_PROPERTY_ID);
@@ -256,7 +256,7 @@ public class JobResourceProvider extends
     @Override
     public Set<Resource> fetchJobDetails(Set<String> requestedIds,
         String clusterName, String workflowId, String jobId) {
-      Set<Resource> jobs = new HashSet<Resource>();
+      Set<Resource> jobs = new HashSet<>();
       ResultSet rs = null;
       try {
         rs = getResultSet(requestedIds, workflowId, jobId);
@@ -333,7 +333,7 @@ public class JobResourceProvider extends
 
   @Override
   protected Map<String,JobFields> getDBFieldMap() {
-    Map<String,JobFields> dbFields = new HashMap<String,JobFields>();
+    Map<String,JobFields> dbFields = new HashMap<>();
     dbFields.put(JOB_WORKFLOW_ID_PROPERTY_ID, JobFields.WORKFLOWID);
     dbFields.put(JOB_ID_PROPERTY_ID, JobFields.JOBID);
     dbFields.put(JOB_NAME_PROPERTY_ID, JobFields.JOBNAME);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
index aaf53bb..0da51bf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
@@ -117,7 +117,7 @@ public class KerberosDescriptorResourceProvider extends AbstractControllerResour
       results = kerberosDescriptorDAO.findAll();
     }
 
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
     Set<String> requestPropertyIds = getRequestPropertyIds(request, predicate);
     for (KerberosDescriptorEntity entity : results) {
       Resource resource = new ResourceImpl(Resource.Type.KerberosDescriptor);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
index ecd61a8..408cd1c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
@@ -97,7 +97,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   /**
    * The key property ids for a event resource.
    */
-  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<Resource.Type, String>();
+  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<>();
   static {
     keyPropertyIds.put(Resource.Type.LdapSyncEvent, EVENT_ID_PROPERTY_ID);
   }
@@ -105,7 +105,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   /**
    * The property ids for a event resource.
    */
-  private static Set<String> propertyIds = new HashSet<String>();
+  private static Set<String> propertyIds = new HashSet<>();
 
   static {
     propertyIds.add(EVENT_ID_PROPERTY_ID);
@@ -135,12 +135,12 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   /**
    * Map of all sync events.
    */
-  private final Map<Long, LdapSyncEventEntity> events = new ConcurrentSkipListMap<Long, LdapSyncEventEntity>();
+  private final Map<Long, LdapSyncEventEntity> events = new ConcurrentSkipListMap<>();
 
   /**
    * The queue of events to be processed.
    */
-  private final Queue<LdapSyncEventEntity> eventQueue = new LinkedList<LdapSyncEventEntity>();
+  private final Queue<LdapSyncEventEntity> eventQueue = new LinkedList<>();
 
   /**
    * Indicates whether or not the events are currently being processed.
@@ -180,14 +180,14 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   public RequestStatus createResourcesAuthorized(Request event)
       throws SystemException, UnsupportedPropertyException,
       ResourceAlreadyExistsException, NoSuchParentResourceException {
-    Set<LdapSyncEventEntity> newEvents = new HashSet<LdapSyncEventEntity>();
+    Set<LdapSyncEventEntity> newEvents = new HashSet<>();
 
     for (Map<String, Object> properties : event.getProperties()) {
       newEvents.add(createResources(getCreateCommand(properties)));
     }
     notifyCreate(Resource.Type.ViewInstance, event);
 
-    Set<Resource> associatedResources = new HashSet<Resource>();
+    Set<Resource> associatedResources = new HashSet<>();
     for (LdapSyncEventEntity eventEntity : newEvents) {
       Resource resource = new ResourceImpl(Resource.Type.LdapSyncEvent);
       resource.setProperty(EVENT_ID_PROPERTY_ID, eventEntity.getId());
@@ -206,7 +206,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   public Set<Resource> getResources(Request event, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    Set<Resource> resources    = new HashSet<Resource>();
+    Set<Resource> resources    = new HashSet<>();
     Set<String>   requestedIds = getRequestPropertyIds(event, predicate);
 
     for (LdapSyncEventEntity eventEntity : events.values()) {
@@ -239,7 +239,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return new HashSet<String>(keyPropertyIds.values());
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 
@@ -282,13 +282,13 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
     setResourceProperty(resource, MEMBERSHIPS_CREATED_PROPERTY_ID, eventEntity.getMembershipsCreated(), requestedIds);
     setResourceProperty(resource, MEMBERSHIPS_REMOVED_PROPERTY_ID, eventEntity.getMembershipsRemoved(), requestedIds);
 
-    Set<Map<String, String>> specs = new HashSet<Map<String, String>>();
+    Set<Map<String, String>> specs = new HashSet<>();
 
     List<LdapSyncSpecEntity> specList = eventEntity.getSpecs();
 
     for (LdapSyncSpecEntity spec : specList) {
 
-      Map<String, String> specMap = new HashMap<String, String>();
+      Map<String, String> specMap = new HashMap<>();
 
       specMap.put(PRINCIPAL_TYPE_SPEC_KEY, spec.getPrincipalType().toString().toLowerCase());
       specMap.put(SYNC_TYPE_SPEC_KEY, spec.getSyncType().toString().toLowerCase());
@@ -311,7 +311,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   // create a event entity from the given set of properties
   private LdapSyncEventEntity toEntity(Map<String, Object> properties) {
     LdapSyncEventEntity      entity   = new LdapSyncEventEntity(getNextEventId());
-    List<LdapSyncSpecEntity> specList = new LinkedList<LdapSyncSpecEntity>();
+    List<LdapSyncSpecEntity> specList = new LinkedList<>();
 
     Set<Map<String, String>> specs = (Set<Map<String, String>>) properties.get(EVENT_SPECS_PROPERTY_ID);
 
@@ -389,7 +389,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
       public Void invoke() throws AmbariException {
         Set<String>  requestedIds = getRequestPropertyIds(PropertyHelper.getReadRequest(), predicate);
 
-        Set<LdapSyncEventEntity> entities = new HashSet<LdapSyncEventEntity>();
+        Set<LdapSyncEventEntity> entities = new HashSet<>();
 
         for (LdapSyncEventEntity entity : events.values()){
               Resource resource = toResource(entity, requestedIds);
@@ -408,7 +408,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   // Get the ldap sync thread pool
   private static synchronized ExecutorService getExecutorService() {
     if (executorService == null) {
-      LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>();
+      LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
 
       ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
           THREAD_POOL_CORE_SIZE,
@@ -507,7 +507,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
       case EXISTING:
         return new LdapSyncRequest(LdapSyncSpecEntity.SyncType.EXISTING);
       case SPECIFIC:
-        Set<String> principalNames = new HashSet<String>(spec.getPrincipalNames());
+        Set<String> principalNames = new HashSet<>(spec.getPrincipalNames());
         if (request == null ) {
           request = new LdapSyncRequest(LdapSyncSpecEntity.SyncType.SPECIFIC, principalNames);
         } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
index b46399c..6a29ff4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
@@ -50,7 +50,7 @@ public class LoggingResourceProvider extends AbstractControllerResourceProvider
   private static final Map<Resource.Type, String> KEY_PROPERTY_IDS;
 
   static {
-    Set<String> localSet = new HashSet<String>();
+    Set<String> localSet = new HashSet<>();
     localSet.add(LOGGING_SEARCH_SERVICE_PROPERTY_ID);
     localSet.add(LOGGING_SEARCH_TERM_PROPERTY_ID);
     localSet.add(LOGGING_COMPONENT_PROPERTY_ID);
@@ -58,7 +58,7 @@ public class LoggingResourceProvider extends AbstractControllerResourceProvider
     PROPERTY_IDS = Collections.unmodifiableSet(localSet);
 
     Map<Resource.Type, String> localMap =
-      new HashMap<Resource.Type, String>();
+      new HashMap<>();
 
     localMap.put(Resource.Type.LoggingQuery, LOGGING_SEARCH_SERVICE_PROPERTY_ID);
     KEY_PROPERTY_IDS = Collections.unmodifiableMap(localMap);
@@ -91,7 +91,7 @@ public class LoggingResourceProvider extends AbstractControllerResourceProvider
       new LoggingRequestHelperFactoryImpl().getHelper(AmbariServer.getController(), "");
 
     Map<String, String> queryParameters =
-      new HashMap<String, String>();
+      new HashMap<>();
 
     queryParameters.put("level", "ERROR");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
index b3470d1..e4afeb2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
@@ -56,9 +56,9 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
   public static final String MEMBER_USER_NAME_PROPERTY_ID  = PropertyHelper.getPropertyId("MemberInfo", "user_name");
 
   private static Set<String> pkPropertyIds =
-      new HashSet<String>(Arrays.asList(new String[]{
-          MEMBER_GROUP_NAME_PROPERTY_ID,
-          MEMBER_USER_NAME_PROPERTY_ID}));
+    new HashSet<>(Arrays.asList(new String[]{
+      MEMBER_GROUP_NAME_PROPERTY_ID,
+      MEMBER_USER_NAME_PROPERTY_ID}));
 
   /**
    * Create a  new resource provider for the given management controller.
@@ -87,7 +87,7 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
              ResourceAlreadyExistsException,
              NoSuchParentResourceException {
 
-    final Set<MemberRequest> requests = new HashSet<MemberRequest>();
+    final Set<MemberRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : request.getProperties()) {
       requests.add(getRequest(propertyMap));
     }
@@ -107,7 +107,7 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
   protected Set<Resource> getResourcesAuthorized(Request request, Predicate predicate) throws
       SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<MemberRequest> requests = new HashSet<MemberRequest>();
+    final Set<MemberRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       requests.add(getRequest(propertyMap));
     }
@@ -124,7 +124,7 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
         + responses.size());
 
     Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
-    Set<Resource> resources    = new HashSet<Resource>();
+    Set<Resource> resources    = new HashSet<>();
 
     for (MemberResponse memberResponse : responses) {
       ResourceImpl resource = new ResourceImpl(Resource.Type.Member);
@@ -145,13 +145,13 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
   protected RequestStatus updateResourcesAuthorized(final Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<MemberRequest> requests = new HashSet<MemberRequest>();
+    final Set<MemberRequest> requests = new HashSet<>();
     for (Map<String, Object> propertyMap : request.getProperties()) {
       requests.add(getRequest(propertyMap));
     }
     if (requests.isEmpty()) {
       // request for removing all users from group
-      Map<String, Object> propertyMap = new HashMap<String, Object>();
+      Map<String, Object> propertyMap = new HashMap<>();
       propertyMap.put(MEMBER_GROUP_NAME_PROPERTY_ID, getQueryParameterValue(MEMBER_GROUP_NAME_PROPERTY_ID, predicate));
       requests.add(getRequest(propertyMap));
     }
@@ -171,7 +171,7 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
   protected RequestStatus deleteResourcesAuthorized(Request request, Predicate predicate)
       throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<MemberRequest> requests = new HashSet<MemberRequest>();
+    final Set<MemberRequest> requests = new HashSet<>();
 
     for (Map<String, Object> propertyMap : getPropertyMaps(predicate)) {
       final MemberRequest req = getRequest(propertyMap);

http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
index fef94be..d487978 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
@@ -82,7 +82,7 @@ public class OperatingSystemResourceProvider extends ReadOnlyResourceProvider {
       throws SystemException, UnsupportedPropertyException,
       NoSuchResourceException, NoSuchParentResourceException {
 
-    final Set<OperatingSystemRequest> requests = new HashSet<OperatingSystemRequest>();
+    final Set<OperatingSystemRequest> requests = new HashSet<>();
 
     if (predicate == null) {
       requests.add(getRequest(Collections.<String, Object>emptyMap()));
@@ -101,7 +101,7 @@ public class OperatingSystemResourceProvider extends ReadOnlyResourceProvider {
       }
     });
 
-    Set<Resource> resources = new HashSet<Resource>();
+    Set<Resource> resources = new HashSet<>();
 
     for (OperatingSystemResponse response : responses) {
       Resource resource = new ResourceImpl(Resource.Type.OperatingSystem);


Mime
View raw message