ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [23/55] [abbrv] ambari git commit: AMBARI-19149. Code cleanup: redundant type arguments
Date Fri, 31 Mar 2017 07:22:30 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
index 35adbcb..9737aaa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/WorkflowResourceProvider.java
@@ -79,9 +79,9 @@ public class WorkflowResourceProvider extends
   protected static final String WORKFLOW_CONTEXT_PROPERTY_ID = PropertyHelper
       .getPropertyId("Workflow", "context");
 
-  private static final Set<String> pkPropertyIds = new HashSet<String>(
-      Arrays.asList(new String[] {WORKFLOW_CLUSTER_NAME_PROPERTY_ID,
-          WORKFLOW_ID_PROPERTY_ID}));
+  private static final Set<String> pkPropertyIds = new HashSet<>(
+    Arrays.asList(new String[]{WORKFLOW_CLUSTER_NAME_PROPERTY_ID,
+      WORKFLOW_ID_PROPERTY_ID}));
 
   protected WorkflowFetcher workflowFetcher;
 
@@ -128,7 +128,7 @@ public class WorkflowResourceProvider 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);
@@ -164,7 +164,7 @@ public class WorkflowResourceProvider 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, WORKFLOW_CLUSTER_NAME_PROPERTY_ID);
     keyPropertyIds.put(Type.Workflow, WORKFLOW_ID_PROPERTY_ID);
     return keyPropertyIds;
@@ -246,7 +246,7 @@ public class WorkflowResourceProvider extends
     @Override
     public Set<Resource> fetchWorkflows(Set<String> requestedIds,
         String clusterName, String workflowId) {
-      Set<Resource> workflows = new HashSet<Resource>();
+      Set<Resource> workflows = new HashSet<>();
       ResultSet rs = null;
       try {
         rs = getResultSet(requestedIds, workflowId);
@@ -309,7 +309,7 @@ public class WorkflowResourceProvider extends
 
   @Override
   protected Map<String,WorkflowFields> getDBFieldMap() {
-    Map<String,WorkflowFields> dbFields = new HashMap<String,WorkflowFields>();
+    Map<String,WorkflowFields> dbFields = new HashMap<>();
     dbFields.put(WORKFLOW_ID_PROPERTY_ID, WorkflowFields.WORKFLOWID);
     dbFields.put(WORKFLOW_NAME_PROPERTY_ID, WorkflowFields.WORKFLOWNAME);
     dbFields.put(WORKFLOW_USER_NAME_PROPERTY_ID, WorkflowFields.USERNAME);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
index 1df5bb4..8002087 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jdbc/JDBCResourceProvider.java
@@ -68,7 +68,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid
     /**
      * Key mappings used for joins.
      */
-    private final Map<String, Map<String, String>> importedKeys = new HashMap<String, Map<String, String>>();
+    private final Map<String, Map<String, String>> importedKeys = new HashMap<>();
 
     protected final static Logger LOG =
             LoggerFactory.getLogger(JDBCResourceProvider.class);
@@ -87,7 +87,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid
     public Set<Resource> getResources(Request request, Predicate predicate)
         throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
 
-        Set<Resource> resources = new HashSet<Resource>();
+        Set<Resource> resources = new HashSet<>();
         Set<String> propertyIds = getRequestPropertyIds(request, predicate);
 
         // Can't allow these properties with the old schema...
@@ -309,7 +309,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid
     private String getSelectSQL(Set<String> propertyIds, Predicate predicate) {
 
         StringBuilder columns = new StringBuilder();
-        Set<String> tableSet = new HashSet<String>();
+        Set<String> tableSet = new HashSet<>();
 
         for (String propertyId : propertyIds) {
             if (columns.length() > 0) {
@@ -444,7 +444,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid
   private void getImportedKeys(Connection connection, String table) throws SQLException {
     if (!this.importedKeys.containsKey(table)) {
 
-      Map<String, String> importedKeys = new HashMap<String, String>();
+      Map<String, String> importedKeys = new HashMap<>();
       this.importedKeys.put(table, importedKeys);
 
       DatabaseMetaData metaData = connection.getMetaData();
@@ -486,7 +486,7 @@ public class JDBCResourceProvider extends BaseProvider implements ResourceProvid
      * @return the set of tables
      */
     private static Set<String> getTables(Set<String> propertyIds) {
-        Set<String> tables = new HashSet<String>();
+        Set<String> tables = new HashSet<>();
         for (String propertyId : propertyIds) {
             tables.add(PropertyHelper.getPropertyCategory(propertyId));
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
index cbc15cb..94282ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
@@ -85,7 +85,7 @@ public class JMXPropertyProvider extends ThreadPoolEnabledPropertyProvider {
   private static final String PORT_KEY = "tag.port";
   private static final String DOT_REPLACEMENT_CHAR = "#";
 
-  private static final Map<String, String> DEFAULT_JMX_PORTS = new HashMap<String, String>();
+  private static final Map<String, String> DEFAULT_JMX_PORTS = new HashMap<>();
 
   /**
    * When Ambari queries NameNode's HA state (among other metrics), it retrieves all metrics from "NN_URL:port/jmx".
@@ -202,7 +202,7 @@ public class JMXPropertyProvider extends ThreadPoolEnabledPropertyProvider {
       throws SystemException {
 
     Set<String> ids = getRequestPropertyIds(request, predicate);
-    Set<String> unsupportedIds = new HashSet<String>();
+    Set<String> unsupportedIds = new HashSet<>();
     String componentName = (String) resource.getPropertyValue(componentNamePropertyId);
 
     if (getComponentMetrics().get(componentName) == null) {
@@ -318,7 +318,7 @@ public class JMXPropertyProvider extends ThreadPoolEnabledPropertyProvider {
   private void getHadoopMetricValue(JMXMetricHolder metricHolder, Set<String> ids,
                        Resource resource, Request request, Ticket ticket) throws IOException {
 
-    Map<String, Map<String, Object>> categories = new HashMap<String, Map<String, Object>>();
+    Map<String, Map<String, Object>> categories = new HashMap<>();
     String componentName = (String) resource.getPropertyValue(componentNamePropertyId);
 
     String clusterName = (String) resource.getPropertyValue(clusterNamePropertyId);
@@ -345,7 +345,7 @@ public class JMXPropertyProvider extends ThreadPoolEnabledPropertyProvider {
           String property = propertyInfo.getPropertyId();
           String category = "";
 
-          List<String> keyList = new LinkedList<String>();
+          List<String> keyList = new LinkedList<>();
 
           int keyStartIndex = property.indexOf('[');
           if (-1 != keyStartIndex) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
index dbcee70..6c3b58e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
@@ -35,7 +35,7 @@ import org.codehaus.jackson.annotate.JsonProperty;
 public class LogLineResult {
 
   private final Map<String, String> mapOfLogLineProperties =
-    new HashMap<String, String>();
+    new HashMap<>();
 
   private String clusterName;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
index e915538..2b1b04a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
@@ -295,7 +295,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
 
   public Set<String> sendGetLogFileNamesRequest(String componentName, String hostName) {
     Map<String, String> queryParameters =
-      new HashMap<String, String>();
+      new HashMap<>();
 
     // TODO, this current method will be a temporary workaround
     // TODO, until the new LogSearch API method is available to handle this request
@@ -403,7 +403,7 @@ public class LoggingRequestHelperImpl implements LoggingRequestHelper {
     URIBuilder uriBuilder = createBasicURI(scheme);
     uriBuilder.setPath(LOGSEARCH_GET_LOG_LEVELS_PATH);
 
-    Map<String, String> queryParameters = new HashMap<String, String>();
+    Map<String, String> queryParameters = new HashMap<>();
     // set the query parameters to limit this level count
     // request to the specific component on the specified host
     queryParameters.put(HOST_QUERY_PARAMETER_NAME, hostName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
index a744e0e..c69d00b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
@@ -113,7 +113,7 @@ public class LoggingSearchPropertyProvider implements PropertyProvider {
           HostComponentLoggingInfo loggingInfo = new HostComponentLoggingInfo();
           loggingInfo.setComponentName(mappedComponentNameForLogSearch);
           List<LogFileDefinitionInfo> listOfFileDefinitions =
-            new LinkedList<LogFileDefinitionInfo>();
+            new LinkedList<>();
 
           for (String fileName : logFileNames) {
             // generate the URIs that can be used by clients to obtain search results/tail log results/etc

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
index 3a1c92f..207a79d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDataTransferMethodFactory.java
@@ -29,7 +29,7 @@ public class MetricsDataTransferMethodFactory {
   private static final Set<String> PERCENTAGE_METRIC;
 
   static {
-    Set<String> percentMetrics = new HashSet<String>();
+    Set<String> percentMetrics = new HashSet<>();
     percentMetrics.add("cpu_wio");
     percentMetrics.add("cpu_idle");
     percentMetrics.add("cpu_nice");
@@ -37,7 +37,7 @@ public class MetricsDataTransferMethodFactory {
     percentMetrics.add("cpu_system");
     percentMetrics.add("cpu_user");
 
-    Set<String> metricsWithAggregateFunctionIds = new HashSet<String>();
+    Set<String> metricsWithAggregateFunctionIds = new HashSet<>();
     for (String metric : percentMetrics) {
       for (String aggregateFunctionId : AGGREGATE_FUNCTION_IDENTIFIERS) {
         metricsWithAggregateFunctionIds.add(metric + aggregateFunctionId);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
index 368362f..f517555 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricsDownsamplingMethodFactory.java
@@ -106,7 +106,7 @@ class MetricsAveragePerSecondDownsampling extends MetricsDownsamplingMethod {
                                      MetricsDataTransferMethod dataTransferMethod,
                                      TemporalInfo temporalInfo) {
 
-    OutOfBandAccumuloFilterList<Accumulo> cache = new OutOfBandAccumuloFilterList<Accumulo>(temporalInfo);
+    OutOfBandAccumuloFilterList<Accumulo> cache = new OutOfBandAccumuloFilterList<>(temporalInfo);
 
     final Iterator<Map.Entry<Long, Double>> ci = metricData.getMetricValues().entrySet().iterator();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
index 7a6021f..f382fbd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
@@ -175,7 +175,7 @@ public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvid
 
     // Remove request properties that request temporal information
     Set<String> ids = getRequestPropertyIds(request, predicate);
-    Set<String> temporalIds = new HashSet<String>();
+    Set<String> temporalIds = new HashSet<>();
     String resourceComponentName = (String) resource.getPropertyValue(componentNamePropertyId);
 
     if (!componentName.equals(resourceComponentName)) {
@@ -228,7 +228,7 @@ public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvid
       rethrowSystemException(e);
     }
 
-    Set<String> resultIds = new HashSet<String>();
+    Set<String> resultIds = new HashSet<>();
     for (String id : ids){
       for (String metricId : propertyInfos.keySet()){
         if (metricId.startsWith(id)){
@@ -271,7 +271,7 @@ public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvid
 
   @Override
   public Set<String> checkPropertyIds(Set<String> propertyIds) {
-    Set<String> unsupported = new HashSet<String>();
+    Set<String> unsupported = new HashSet<>();
     for (String propertyId : propertyIds) {
       if (!getComponentMetrics().
           get(StackDefinedPropertyProvider.WRAPPED_METRICS_KEY).
@@ -444,7 +444,7 @@ public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvid
    */
   private HashMap<String, Set<String>> extractPropertyURLs(Set<String> ids,
                                                            Map<String, PropertyInfo> propertyInfos) {
-    HashMap<String, Set<String>> result = new HashMap<String, Set<String>>();
+    HashMap<String, Set<String>> result = new HashMap<>();
     for (String requestedPropertyId : ids) {
       PropertyInfo propertyInfo = propertyInfos.get(requestedPropertyId);
 
@@ -452,7 +452,7 @@ public class RestMetricsPropertyProvider extends ThreadPoolEnabledPropertyProvid
       String url = extractMetricsURL(metricsPath);
       Set<String> set;
       if (!result.containsKey(url)) {
-        set = new HashSet<String>();
+        set = new HashSet<>();
         result.put(url, set);
       } else {
         set = result.get(url);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
index 367c339..49472f5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ThreadPoolEnabledPropertyProvider.java
@@ -166,7 +166,7 @@ public abstract class ThreadPoolEnabledPropertyProvider extends AbstractProperty
     // configured with a boundary, then the buffered service ensures that no
     // requests are discarded.
     final CompletionService<Resource> completionService =
-        new BufferedThreadPoolExecutorCompletionService<Resource>(EXECUTOR_SERVICE);
+      new BufferedThreadPoolExecutorCompletionService<>(EXECUTOR_SERVICE);
 
     // In a large cluster we could have thousands of resources to populate here.
     // Distribute the work across multiple threads.
@@ -175,7 +175,7 @@ public abstract class ThreadPoolEnabledPropertyProvider extends AbstractProperty
           getPopulateResourceCallable(resource, request, predicate, ticket));
     }
 
-    Set<Resource> keepers = new HashSet<Resource>();
+    Set<Resource> keepers = new HashSet<>();
     try {
       for (int i = 0; i < resources.size(); ++i) {
         Future<Resource> resourceFuture = completionService.poll(COMPLETION_SERVICE_POLL_TIMEOUT,

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaComponentPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaComponentPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaComponentPropertyProvider.java
index 01a4c95..babcc07 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaComponentPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaComponentPropertyProvider.java
@@ -65,8 +65,8 @@ public class GangliaComponentPropertyProvider extends GangliaPropertyProvider {
   protected Set<String> getGangliaClusterNames(Resource resource, String clusterName) {
     String component = getComponentName(resource);
     
-    return new HashSet<String>(GANGLIA_CLUSTER_NAME_MAP.containsKey(component) ?
-        GANGLIA_CLUSTER_NAME_MAP.get(component) :
-          Collections.<String>emptyList());    
+    return new HashSet<>(GANGLIA_CLUSTER_NAME_MAP.containsKey(component) ?
+      GANGLIA_CLUSTER_NAME_MAP.get(component) :
+      Collections.<String>emptyList());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostComponentPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostComponentPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostComponentPropertyProvider.java
index 9d43c14..17f15d6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostComponentPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostComponentPropertyProvider.java
@@ -64,8 +64,8 @@ public class GangliaHostComponentPropertyProvider extends GangliaPropertyProvide
   protected Set<String> getGangliaClusterNames(Resource resource, String clusterName) {
     String component = getComponentName(resource);
     
-    return new HashSet<String>(GANGLIA_CLUSTER_NAME_MAP.containsKey(component) ?
-        GANGLIA_CLUSTER_NAME_MAP.get(component) :
-          Collections.<String>emptyList());
+    return new HashSet<>(GANGLIA_CLUSTER_NAME_MAP.containsKey(component) ?
+      GANGLIA_CLUSTER_NAME_MAP.get(component) :
+      Collections.<String>emptyList());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostPropertyProvider.java
index 6e241e1..230fcb4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaHostPropertyProvider.java
@@ -36,7 +36,7 @@ public class GangliaHostPropertyProvider extends GangliaPropertyProvider {
   /**
    * Set of Ganglia cluster names.
    */
-  private static final Set<String> GANGLIA_CLUSTER_NAMES = new HashSet<String>();
+  private static final Set<String> GANGLIA_CLUSTER_NAMES = new HashSet<>();
 
   static {
     GANGLIA_CLUSTER_NAMES.add("HDPNameNode");

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaMetric.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaMetric.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaMetric.java
index 2a53aac..c60be11 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaMetric.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaMetric.java
@@ -70,7 +70,7 @@ public class GangliaMetric {
   //BUG-3386 Cluster CPU Chart is off the charts
   // Here can be added other percentage metrics
   static {
-    Set<String> temp = new HashSet<String>();
+    Set<String> temp = new HashSet<>();
     temp.add("cpu_wio");
     temp.add("cpu_idle");
     temp.add("cpu_nice");

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
index 1796e27..4b48496 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaPropertyProvider.java
@@ -58,7 +58,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
   /**
    * Map of Ganglia cluster names keyed by component type.
    */
-  static final Map<String, List<String>> GANGLIA_CLUSTER_NAME_MAP = new HashMap<String, List<String>>();
+  static final Map<String, List<String>> GANGLIA_CLUSTER_NAME_MAP = new HashMap<>();
 
   
   static {
@@ -177,13 +177,13 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
                                                                     Set<String> ids) {
 
     Map<String, Map<TemporalInfo, RRDRequest>> requestMap =
-        new HashMap<String, Map<TemporalInfo, RRDRequest>>();
+      new HashMap<>();
 
     for (Resource resource : resources) {
       String clusterName = (String) resource.getPropertyValue(clusterNamePropertyId);
       Map<TemporalInfo, RRDRequest> requests = requestMap.get(clusterName);
       if (requests == null) {
-        requests = new HashMap<TemporalInfo, RRDRequest>();
+        requests = new HashMap<>();
         requestMap.put(clusterName, requests);
       }
 
@@ -194,7 +194,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
             new ResourceKey(getHostName(resource), gangliaClusterName);
 
         for (String id : ids) {
-          Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>();
+          Map<String, PropertyInfo> propertyInfoMap = new HashMap<>();
 
           Map<String, PropertyInfo> componentMetricMap =
             getComponentMetrics().get(getComponentName(resource));
@@ -334,10 +334,10 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
     private static final int POPULATION_TIME_UPPER_LIMIT = 5;
     private final String clusterName;
     private final TemporalInfo temporalInfo;
-    private final Map<ResourceKey, Set<Resource>> resources = new HashMap<ResourceKey, Set<Resource>>();
-    private final Map<String, Set<String>> metrics = new HashMap<String, Set<String>>();
-    private final Set<String> clusterSet = new HashSet<String>();
-    private final Set<String> hostSet = new HashSet<String>();
+    private final Map<ResourceKey, Set<Resource>> resources = new HashMap<>();
+    private final Map<String, Set<String>> metrics = new HashMap<>();
+    private final Set<String> clusterSet = new HashSet<>();
+    private final Set<String> hostSet = new HashSet<>();
 
 
     private RRDRequest(String clusterName, TemporalInfo temporalInfo) {
@@ -350,7 +350,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
       hostSet.add(key.getHostName());
       Set<Resource> resourceSet = resources.get(key);
       if (resourceSet == null) {
-        resourceSet = new HashSet<Resource>();
+        resourceSet = new HashSet<>();
         resources.put(key, resourceSet);
       }
       resourceSet.add(resource);
@@ -360,7 +360,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
       Set<String> propertyIds = metrics.get(metric);
 
       if (propertyIds == null) {
-        propertyIds = new HashSet<String>();
+        propertyIds = new HashSet<>();
         metrics.put(metric, propertyIds);
       }
       propertyIds.add(id);
@@ -429,7 +429,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
         while(!"[~EOF]".equals(dsName)) {
           GangliaMetric metric = new GangliaMetric();
           List<GangliaMetric.TemporalMetric> listTemporalMetrics =
-              new ArrayList<GangliaMetric.TemporalMetric>();
+            new ArrayList<>();
 
           metric.setDs_name(dsName);
           metric.setCluster_name(reader.readLine());
@@ -532,7 +532,7 @@ public abstract class GangliaPropertyProvider extends MetricsPropertyProvider {
       List<String> parameterList = null;
       if (metric_name != null) {
         propertyIdSet = metrics.get(metric_name);
-        parameterList = new LinkedList<String>();
+        parameterList = new LinkedList<>();
 
         if (propertyIdSet == null) {
           for (Map.Entry<String, Set<String>> entry : metrics.entrySet()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
index 578c622..e35af74 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/ganglia/GangliaReportPropertyProvider.java
@@ -71,7 +71,7 @@ public class GangliaReportPropertyProvider extends MetricsReportPropertyProvider
   public Set<Resource> populateResources(Set<Resource> resources, Request request, Predicate predicate)
       throws SystemException {
 
-    Set<Resource> keepers = new HashSet<Resource>();
+    Set<Resource> keepers = new HashSet<>();
     for (Resource resource : resources) {
       if (populateResource(resource, request, predicate)) {
         keepers.add(resource);
@@ -152,7 +152,7 @@ public class GangliaReportPropertyProvider extends MetricsReportPropertyProvider
   }
 
   private Map<String, Map<String, String>> getPropertyIdMaps(Request request, Set<String> ids) {
-    Map<String, Map<String, String>> propertyMap = new HashMap<String, Map<String, String>>();
+    Map<String, Map<String, String>> propertyMap = new HashMap<>();
 
     for (String id : ids) {
       Map<String, PropertyInfo> propertyInfoMap = getPropertyInfoMap("*", id);
@@ -175,7 +175,7 @@ public class GangliaReportPropertyProvider extends MetricsReportPropertyProvider
           if (report !=  null) {
             Map<String, String> map = propertyMap.get(report);
             if (map == null) {
-              map = new HashMap<String, String>();
+              map = new HashMap<>();
               propertyMap.put(report, map);
             }
             map.put(propertyName, propertyId);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
index 759f595..c4c2ddc 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java
@@ -119,7 +119,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
    */
   @Override
   public Set<String> checkPropertyIds(Set<String> propertyIds) {
-    Set<String> supportedIds = new HashSet<String>();
+    Set<String> supportedIds = new HashSet<>();
     for (String propertyId : propertyIds) {
       if (propertyId.startsWith(ZERO_PADDING_PARAM)
           || PropertyHelper.hasAggregateFunctionSuffix(propertyId)) {
@@ -135,15 +135,15 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
    */
   class MetricsRequest {
     private final TemporalInfo temporalInfo;
-    private final Map<String, Set<Resource>> resources = new HashMap<String, Set<Resource>>();
-    private final Map<String, Set<String>> metrics = new HashMap<String, Set<String>>();
+    private final Map<String, Set<Resource>> resources = new HashMap<>();
+    private final Map<String, Set<String>> metrics = new HashMap<>();
     private final URIBuilder uriBuilder;
     Set<String> resolvedMetricsParams;
     MetricsRequestHelper requestHelper = new MetricsRequestHelper(streamProvider);
 
     // Metrics with amsHostMetric = true
     // Basically a host metric to be returned for a hostcomponent
-    private final Set<String> hostComponentHostMetrics = new HashSet<String>();
+    private final Set<String> hostComponentHostMetrics = new HashSet<>();
     private String clusterName;
     private Map<String, Set<String>> componentMetricMap = new HashMap<>();
 
@@ -161,7 +161,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
     public void putResource(String componentName, Resource resource) {
       Set<Resource> resourceSet = resources.get(componentName);
       if (resourceSet == null) {
-        resourceSet = new HashSet<Resource>();
+        resourceSet = new HashSet<>();
         resources.put(componentName, resourceSet);
       }
       resourceSet.add(resource);
@@ -171,7 +171,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
       Set<String> propertyIds = metrics.get(metric);
 
       if (propertyIds == null) {
-        propertyIds = new HashSet<String>();
+        propertyIds = new HashSet<>();
         metrics.put(metric, propertyIds);
       }
       propertyIds.add(id);
@@ -367,7 +367,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
 
     private Set<String> createPatterns(Set<String> rawNames) {
       Pattern pattern = Pattern.compile(METRIC_REGEXP_PATTERN);
-      Set<String> result = new HashSet<String>();
+      Set<String> result = new HashSet<>();
       for (String rawName : rawNames) {
         Matcher matcher = pattern.matcher(rawName);
         StringBuilder sb = new StringBuilder();
@@ -393,7 +393,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
     }
 
     private Set<String> processRegexps(Set<String> metricNames) {
-      Set<String> result = new HashSet<String>();
+      Set<String> result = new HashSet<>();
       for (String name : metricNames) {
         result.add(name.replaceAll(METRIC_REGEXP_PATTERN, Matcher.quoteReplacement("%")));
       }
@@ -404,7 +404,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
                                   TemporalInfo temporalInfo) {
       String metric_name = metric.getMetricName();
       Set<String> propertyIdSet = metrics.get(metric_name);
-      List<String> parameterList  = new LinkedList<String>();
+      List<String> parameterList  = new LinkedList<>();
 
       if (propertyIdSet == null) {
         for (Map.Entry<String, Set<String>> entry : metrics.entrySet()) {
@@ -561,7 +561,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
     } else {
       metricPropertyIds = PropertyHelper.getMetricPropertyIds(Resource.Type.Component);
     }
-    Map<String, PropertyInfo> amsMetrics = new HashMap<String, PropertyInfo>();
+    Map<String, PropertyInfo> amsMetrics = new HashMap<>();
     if (metricPropertyIds.containsKey(HBASE_MASTER.name())) {
       amsMetrics.putAll(metricPropertyIds.get(HBASE_MASTER.name()));
     }
@@ -587,7 +587,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
               Set<Resource> resources, Request request, Set<String> ids) throws SystemException {
 
     Map<String, Map<TemporalInfo, MetricsRequest>> requestMap =
-      new HashMap<String, Map<TemporalInfo, MetricsRequest>>();
+      new HashMap<>();
 
     String collectorPort = null;
     Map<String, Boolean> clusterCollectorComponentLiveMap = new HashMap<>();
@@ -645,7 +645,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
 
       Map<TemporalInfo, MetricsRequest> requests = requestMap.get(clusterName);
       if (requests == null) {
-        requests = new HashMap<TemporalInfo, MetricsRequest>();
+        requests = new HashMap<>();
         requestMap.put(clusterName, requests);
       }
 
@@ -656,7 +656,7 @@ public abstract class AMSPropertyProvider extends MetricsPropertyProvider {
       }
 
       for (String id : ids) {
-        Map<String, PropertyInfo> propertyInfoMap = new HashMap<String, PropertyInfo>();
+        Map<String, PropertyInfo> propertyInfoMap = new HashMap<>();
 
         String componentName = getOverridenComponentName(resource);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
index 96e3621..c1576a3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java
@@ -82,7 +82,7 @@ public class AMSReportPropertyProvider extends MetricsReportPropertyProvider {
    */
   @Override
   public Set<String> checkPropertyIds(Set<String> propertyIds) {
-    Set<String> supportedIds = new HashSet<String>();
+    Set<String> supportedIds = new HashSet<>();
     for (String propertyId : propertyIds) {
       if (propertyId.startsWith(ZERO_PADDING_PARAM)
           || PropertyHelper.hasAggregateFunctionSuffix(propertyId)) {
@@ -97,7 +97,7 @@ public class AMSReportPropertyProvider extends MetricsReportPropertyProvider {
   public Set<Resource> populateResources(Set<Resource> resources,
                Request request, Predicate predicate) throws SystemException {
 
-    Set<Resource> keepers = new HashSet<Resource>();
+    Set<Resource> keepers = new HashSet<>();
     for (Resource resource : resources) {
       if (populateResource(resource, request, predicate)) {
         keepers.add(resource);
@@ -253,7 +253,7 @@ public class AMSReportPropertyProvider extends MetricsReportPropertyProvider {
   }
 
   private Map<String, MetricReportRequest> getPropertyIdMaps(Request request, Set<String> ids) {
-    Map<String, MetricReportRequest> propertyMap = new HashMap<String, MetricReportRequest>();
+    Map<String, MetricReportRequest> propertyMap = new HashMap<>();
 
     for (String id : ids) {
       Map<String, PropertyInfo> propertyInfoMap = getPropertyInfoMap("*", id);
@@ -290,7 +290,7 @@ public class AMSReportPropertyProvider extends MetricsReportPropertyProvider {
 
   class MetricReportRequest {
     private TemporalInfo temporalInfo;
-    private Map<String, String> propertyIdMap = new HashMap<String, String>();
+    private Map<String, String> propertyIdMap = new HashMap<>();
 
     public TemporalInfo getTemporalInfo() {
       return temporalInfo;

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
index 036962b..932345b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/cache/TimelineMetricCacheEntryFactory.java
@@ -212,7 +212,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
     if (newMetrics != null && !newMetrics.getMetrics().isEmpty()) {
       for (TimelineMetric timelineMetric : newMetrics.getMetrics()) {
         if (LOG.isTraceEnabled()) {
-          TreeMap<Long, Double> sortedMetrics = new TreeMap<Long, Double>(timelineMetric.getMetricValues());
+          TreeMap<Long, Double> sortedMetrics = new TreeMap<>(timelineMetric.getMetricValues());
 
           LOG.trace("New metric: " + timelineMetric.getMetricName() +
             " # " + timelineMetric.getMetricValues().size() + ", startTime = " +
@@ -232,7 +232,7 @@ public class TimelineMetricCacheEntryFactory implements UpdatingCacheEntryFactor
           existingMetric.getMetricValues().putAll(timelineMetric.getMetricValues());
 
           if (LOG.isTraceEnabled()) {
-            TreeMap<Long, Double> sortedMetrics = new TreeMap<Long, Double>(existingMetric.getMetricValues());
+            TreeMap<Long, Double> sortedMetrics = new TreeMap<>(existingMetric.getMetricValues());
             LOG.trace("Merged metric: " + timelineMetric.getMetricName() + ", " +
               "Final size: " + existingMetric.getMetricValues().size() + ", startTime = " +
               sortedMetrics.firstKey() + ", endTime = " + sortedMetrics.lastKey());

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/AndPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/AndPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/AndPredicate.java
index 70c0069..6753c6c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/AndPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/AndPredicate.java
@@ -42,7 +42,7 @@ public class AndPredicate extends ArrayPredicate {
   }
 
   public static Predicate instance(Predicate... predicates) {
-    List<Predicate> predicateList = new LinkedList<Predicate>();
+    List<Predicate> predicateList = new LinkedList<>();
 
     // Simplify the predicate array
     for (Predicate predicate : predicates) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ArrayPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ArrayPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ArrayPredicate.java
index 2bcf64e..7103440 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ArrayPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/ArrayPredicate.java
@@ -30,7 +30,7 @@ import org.apache.ambari.server.controller.utilities.PredicateHelper;
  */
 public abstract class ArrayPredicate implements BasePredicate {
   private final Predicate[] predicates;
-  private final Set<String> propertyIds = new HashSet<String>();
+  private final Set<String> propertyIds = new HashSet<>();
 
   // ----- Constructors -----------------------------------------------------
 
@@ -101,15 +101,15 @@ public abstract class ArrayPredicate implements BasePredicate {
     if (propertyIds != null ? !propertyIds.equals(that.propertyIds) : that.propertyIds != null) return false;
 
     // don't care about array order
-    Set<Predicate> setThisPredicates = new HashSet<Predicate>(Arrays.asList(predicates));
-    Set<Predicate> setThatPredicates = new HashSet<Predicate>(Arrays.asList(that.predicates));
+    Set<Predicate> setThisPredicates = new HashSet<>(Arrays.asList(predicates));
+    Set<Predicate> setThatPredicates = new HashSet<>(Arrays.asList(that.predicates));
     return setThisPredicates.equals(setThatPredicates);
   }
 
   @Override
   public int hashCode() {
     // don't care about array order
-    int result = predicates != null ? new HashSet<Predicate>(Arrays.asList(predicates)).hashCode() : 0;
+    int result = predicates != null ? new HashSet<>(Arrays.asList(predicates)).hashCode() : 0;
     result = 31 * result + (propertyIds != null ? propertyIds.hashCode() : 0);
     return result;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
index 7ac0e7a..7431bb4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/EqualsPredicate.java
@@ -61,6 +61,6 @@ public class EqualsPredicate<T> extends ComparisonPredicate<T> {
 
   @Override
   public ComparisonPredicate<T> copy(String propertyId) {
-    return new EqualsPredicate<T>(propertyId, getValue());
+    return new EqualsPredicate<>(propertyId, getValue());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterEqualsPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterEqualsPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterEqualsPredicate.java
index a1c5e30..1aeb1ed 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterEqualsPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterEqualsPredicate.java
@@ -53,6 +53,6 @@ public class GreaterEqualsPredicate<T> extends ComparisonPredicate<T> {
 
   @Override
   public ComparisonPredicate<T> copy(String propertyId) {
-    return new GreaterEqualsPredicate<T>(propertyId, getValue());
+    return new GreaterEqualsPredicate<>(propertyId, getValue());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterPredicate.java
index 017e6bc..a10e0f2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/GreaterPredicate.java
@@ -52,6 +52,6 @@ public class GreaterPredicate<T> extends ComparisonPredicate<T> {
 
   @Override
   public ComparisonPredicate<T> copy(String propertyId) {
-    return new GreaterPredicate<T>(propertyId, getValue());
+    return new GreaterPredicate<>(propertyId, getValue());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessEqualsPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessEqualsPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessEqualsPredicate.java
index 2d6938f..393aeec 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessEqualsPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessEqualsPredicate.java
@@ -53,6 +53,6 @@ public class LessEqualsPredicate<T> extends ComparisonPredicate<T> {
 
   @Override
   public ComparisonPredicate<T> copy(String propertyId) {
-    return new LessEqualsPredicate<T>(propertyId, getValue());
+    return new LessEqualsPredicate<>(propertyId, getValue());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessPredicate.java
index 5a71134..afe31b3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/LessPredicate.java
@@ -52,6 +52,6 @@ public class LessPredicate<T> extends ComparisonPredicate<T> {
 
   @Override
   public ComparisonPredicate<T> copy(String propertyId) {
-    return new LessPredicate<T>(propertyId, getValue());
+    return new LessPredicate<>(propertyId, getValue());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/OrPredicate.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/OrPredicate.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/OrPredicate.java
index ba85185..047272a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/OrPredicate.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/OrPredicate.java
@@ -40,7 +40,7 @@ public class OrPredicate extends ArrayPredicate {
   }
 
   public static Predicate instance(Predicate... predicates) {
-    List<Predicate> predicateList = new LinkedList<Predicate>();
+    List<Predicate> predicateList = new LinkedList<>();
 
     // Simplify the predicate array
     for (Predicate predicate : predicates) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
index 30cf073..58bad50 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
@@ -185,7 +185,7 @@ public interface Resource {
     /**
      * Map of all registered types.
      */
-    private static Map<String, Type> types = new ConcurrentHashMap<String, Type>();
+    private static Map<String, Type> types = new ConcurrentHashMap<>();
 
     /**
      * Ordinal number counter for registering external types.

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/BufferedThreadPoolExecutorCompletionService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/BufferedThreadPoolExecutorCompletionService.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/BufferedThreadPoolExecutorCompletionService.java
index 9f31fef..a57b793 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/BufferedThreadPoolExecutorCompletionService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/BufferedThreadPoolExecutorCompletionService.java
@@ -52,7 +52,7 @@ public class BufferedThreadPoolExecutorCompletionService<V> extends ExecutorComp
   public BufferedThreadPoolExecutorCompletionService(ThreadPoolExecutor executor) {
     super(executor);
     this.executor = executor;
-    this.overflowQueue = new LinkedBlockingQueue<Runnable>();
+    this.overflowQueue = new LinkedBlockingQueue<>();
     this.executor.setRejectedExecutionHandler(new RejectedExecutionHandler() {
       /**
        * Once the ThreadPoolExecutor is at full capacity, it starts to reject

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateBuilder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateBuilder.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateBuilder.java
index 6c28e38..e971faf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateBuilder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateBuilder.java
@@ -36,7 +36,7 @@ import org.apache.ambari.server.controller.spi.Predicate;
 public class PredicateBuilder {
 
   private String propertyId;
-  private List<Predicate> predicates = new LinkedList<Predicate>();
+  private List<Predicate> predicates = new LinkedList<>();
   private Operator operator = null;
   private final PredicateBuilder outer;
   private boolean done = false;
@@ -142,7 +142,7 @@ public class PredicateBuilder {
       if (propertyId == null) {
         throw new IllegalStateException("No property.");
       }
-      addPredicate(new EqualsPredicate<T>(propertyId, value));
+      addPredicate(new EqualsPredicate<>(propertyId, value));
 
       return new PredicateBuilderWithPredicate();
     }
@@ -152,7 +152,7 @@ public class PredicateBuilder {
       if (propertyId == null) {
         throw new IllegalStateException("No property.");
       }
-      addPredicate(new GreaterPredicate<T>(propertyId, value));
+      addPredicate(new GreaterPredicate<>(propertyId, value));
 
       return new PredicateBuilderWithPredicate();
     }
@@ -162,7 +162,7 @@ public class PredicateBuilder {
       if (propertyId == null) {
         throw new IllegalStateException("No property.");
       }
-      addPredicate(new GreaterEqualsPredicate<T>(propertyId, value));
+      addPredicate(new GreaterEqualsPredicate<>(propertyId, value));
 
       return new PredicateBuilderWithPredicate();
     }
@@ -172,7 +172,7 @@ public class PredicateBuilder {
       if (propertyId == null) {
         throw new IllegalStateException("No property.");
       }
-      addPredicate(new LessPredicate<T>(propertyId, value));
+      addPredicate(new LessPredicate<>(propertyId, value));
 
       return new PredicateBuilderWithPredicate();
     }
@@ -182,7 +182,7 @@ public class PredicateBuilder {
       if (propertyId == null) {
         throw new IllegalStateException("No property.");
       }
-      addPredicate(new LessEqualsPredicate<T>(propertyId, value));
+      addPredicate(new LessEqualsPredicate<>(propertyId, value));
 
       return new PredicateBuilderWithPredicate();
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java
index 4681b08..c747a33 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PropertyHelper.java
@@ -123,7 +123,7 @@ public class PropertyHelper {
    * @return the set of property ids
    */
   public static Set<String> getPropertyIds(Map<String, Map<String, PropertyInfo>> componentPropertyInfoMap ) {
-    Set<String> propertyIds = new HashSet<String>();
+    Set<String> propertyIds = new HashSet<>();
 
     for (Map.Entry<String, Map<String, PropertyInfo>> entry : componentPropertyInfoMap.entrySet()) {
       propertyIds.addAll(entry.getValue().keySet());
@@ -247,7 +247,7 @@ public class PropertyHelper {
    * @return the set of categories
    */
   public static Set<String> getCategories(Set<String> propertyIds) {
-    Set<String> categories = new HashSet<String>();
+    Set<String> categories = new HashSet<>();
     for (String property : propertyIds) {
       String category = PropertyHelper.getPropertyCategory(property);
       while (category != null) {
@@ -311,9 +311,9 @@ public class PropertyHelper {
     Set<String> ids = request.getPropertyIds();
 
     if (ids != null) {
-      ids = new HashSet<String>(ids);
+      ids = new HashSet<>(ids);
     } else {
-      ids = new HashSet<String>();
+      ids = new HashSet<>();
     }
 
     Set<Map<String, Object>> properties = request.getProperties();
@@ -333,7 +333,7 @@ public class PropertyHelper {
    * @return the map of properties for the given resource
    */
   public static Map<String, Object> getProperties(Resource resource) {
-    Map<String, Object> properties = new HashMap<String, Object>();
+    Map<String, Object> properties = new HashMap<>();
 
     Map<String, Map<String, Object>> categories = resource.getPropertiesMap();
 
@@ -413,8 +413,8 @@ public class PropertyHelper {
    * @param propertyIds  the property ids associated with the request; may be null
    */
   public static Request getReadRequest(String ... propertyIds) {
-    return PropertyHelper.getReadRequest(new HashSet<String>(
-        Arrays.asList(propertyIds)));
+    return PropertyHelper.getReadRequest(new HashSet<>(
+      Arrays.asList(propertyIds)));
   }
 
   /**
@@ -438,13 +438,13 @@ public class PropertyHelper {
               new TypeReference<Map<Resource.InternalType, Map<String, Map<String, Metric>>>>() {});
 
       Map<Resource.InternalType, Map<String, Map<String, PropertyInfo>>> resourceMetrics =
-          new HashMap<Resource.InternalType, Map<String, Map<String, PropertyInfo>>>();
+        new HashMap<>();
 
       for (Map.Entry<Resource.InternalType, Map<String, Map<String, Metric>>> resourceEntry : resourceMetricMap.entrySet()) {
-        Map<String, Map<String, PropertyInfo>> componentMetrics = new HashMap<String, Map<String, PropertyInfo>>();
+        Map<String, Map<String, PropertyInfo>> componentMetrics = new HashMap<>();
 
         for (Map.Entry<String, Map<String, Metric>> componentEntry : resourceEntry.getValue().entrySet()) {
-          Map<String, PropertyInfo> metrics = new HashMap<String, PropertyInfo>();
+          Map<String, PropertyInfo> metrics = new HashMap<>();
 
           for (Map.Entry<String, Metric> metricEntry : componentEntry.getValue().entrySet()) {
             String property = metricEntry.getKey();
@@ -489,11 +489,11 @@ public class PropertyHelper {
               new TypeReference<Map<Resource.InternalType, Map<Resource.InternalType, String>>>() {});
 
       Map<Resource.InternalType, Map<Resource.Type, String>> returnMap =
-          new HashMap<Resource.InternalType, Map<Resource.Type, String>>();
+        new HashMap<>();
 
       // convert inner maps from InternalType to Type
       for (Map.Entry<Resource.InternalType, Map<Resource.InternalType, String>> entry : map.entrySet()) {
-        Map<Resource.Type, String> innerMap = new HashMap<Resource.Type, String>();
+        Map<Resource.Type, String> innerMap = new HashMap<>();
 
         for (Map.Entry<Resource.InternalType, String> entry1 : entry.getValue().entrySet()) {
           innerMap.put(Resource.Type.valueOf(entry1.getKey().name()), entry1.getValue());
@@ -593,7 +593,7 @@ public class PropertyHelper {
     for (Map.Entry<String, Map<String, PropertyInfo>> metricInfoEntry : metrics.entrySet()) {
       Map<String, PropertyInfo> metricInfo = metricInfoEntry.getValue();
 
-      Map<String, PropertyInfo> aggregateMetrics = new HashMap<String, PropertyInfo>();
+      Map<String, PropertyInfo> aggregateMetrics = new HashMap<>();
       // For every metric
       for (Map.Entry<String, PropertyInfo> metricEntry : metricInfo.entrySet()) {
         // For each aggregate function id

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java b/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
index 7e93f23..7a2738b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionManager.java
@@ -48,7 +48,7 @@ public class ActionDefinitionManager {
   private final static Logger LOG = LoggerFactory
       .getLogger(ActionDefinitionManager.class);
   private static final Map<Class<?>, JAXBContext> _jaxbContexts =
-      new HashMap<Class<?>, JAXBContext>();
+    new HashMap<>();
   private static final Short MAX_TIMEOUT = Short.MAX_VALUE-1;
 
   static {
@@ -60,7 +60,7 @@ public class ActionDefinitionManager {
     }
   }
 
-  private final Map<String, ActionDefinition> actionDefinitionMap = new HashMap<String, ActionDefinition>();
+  private final Map<String, ActionDefinition> actionDefinitionMap = new HashMap<>();
 
   public ActionDefinitionManager() {
   }
@@ -179,7 +179,7 @@ public class ActionDefinitionManager {
   }
 
   public List<ActionDefinition> getAllActionDefinition() {
-    return new ArrayList<ActionDefinition>(actionDefinitionMap.values());
+    return new ArrayList<>(actionDefinitionMap.values());
   }
 
   public ActionDefinition getActionDefinition(String name) {
@@ -222,7 +222,7 @@ public class ActionDefinitionManager {
     if (StringUtils.isEmpty(permissions)) {
       return null;
     } else {
-      Set<RoleAuthorization> authorizations = new HashSet<RoleAuthorization>();
+      Set<RoleAuthorization> authorizations = new HashSet<>();
       String[] parts = permissions.split(",");
 
       for (String permission : parts) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionXml.java b/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionXml.java
index 829c4ba..8ef64ef 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/customactions/ActionDefinitionXml.java
@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 public class ActionDefinitionXml {
   
   @XmlElement(name="actionDefinition")
-  private List<ActionDefinitionSpec> actionDefinitions = new ArrayList<ActionDefinitionSpec>();
+  private List<ActionDefinitionSpec> actionDefinitions = new ArrayList<>();
   
   /**
    * @return the list of properties contained in a configuration file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertAggregateListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertAggregateListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertAggregateListener.java
index d982c2f..1ed19a4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertAggregateListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertAggregateListener.java
@@ -92,7 +92,7 @@ public class AlertAggregateListener {
    * shouldn't need to fire new aggregate alerts unless the state or text has
    * changed.
    */
-  private Map<String, Alert> m_alertCache = new ConcurrentHashMap<String, Alert>();
+  private Map<String, Alert> m_alertCache = new ConcurrentHashMap<>();
 
   /**
    * Used for quick lookups of aggregate alerts.

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHostListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHostListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHostListener.java
index 79ba4b4..f722435 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHostListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertHostListener.java
@@ -124,7 +124,7 @@ public class AlertHostListener {
     List<AlertDefinition> agentDefinitions = m_ambariServiceAlertDefinitions.getAgentDefinitions();
     List<AlertDefinition> serverDefinitions = m_ambariServiceAlertDefinitions.getServerDefinitions();
 
-    List<AlertDefinition> ambariServiceDefinitions = new ArrayList<AlertDefinition>();
+    List<AlertDefinition> ambariServiceDefinitions = new ArrayList<>();
     ambariServiceDefinitions.addAll(agentDefinitions);
     ambariServiceDefinitions.addAll(serverDefinitions);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
index 4d908e9..ce55203 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
@@ -159,7 +159,7 @@ public class AlertStateChangedListener {
     }
 
     List<AlertGroupEntity> groups = m_alertsDispatchDao.findGroupsByDefinition(definition);
-    List<AlertNoticeEntity> notices = new LinkedList<AlertNoticeEntity>();
+    List<AlertNoticeEntity> notices = new LinkedList<>();
 
     // for each group, determine if there are any targets that need to receive
     // a notification about the alert state change event

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
index bc146ef..93eef36 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
@@ -554,7 +554,7 @@ public class TaskStatusListener {
     private Set <Long> taskIds;
 
     //Map of roles to successFactors for this stage. Default is 1 i.e. 100%
-    private Map<Role, Float> successFactors = new HashMap<Role, Float>();
+    private Map<Role, Float> successFactors = new HashMap<>();
 
     public ActiveStage(HostRoleStatus status, HostRoleStatus displayStatus,
                        Map<Role, Float> successFactors, Boolean skippable, Set<Long> taskIds) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
index 51ee285..b4ddf09 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
@@ -224,11 +224,11 @@ public class HostVersionOutOfSyncListener {
 
     try {
       Cluster cluster = clusters.get().getClusterById(event.getClusterId());
-      Set<RepositoryVersionEntity> changedRepositoryVersions = new HashSet<RepositoryVersionEntity>();
+      Set<RepositoryVersionEntity> changedRepositoryVersions = new HashSet<>();
       Map<String, ServiceComponent> serviceComponents = cluster.getService(event.getServiceName()).getServiceComponents();
       // Determine hosts that become OUT_OF_SYNC when adding components for new service
       Map<String, List<ServiceComponent>> affectedHosts =
-              new HashMap<String, List<ServiceComponent>>();
+        new HashMap<>();
       for (ServiceComponent component : serviceComponents.values()) {
         for (String hostname : component.getServiceComponentHosts().keySet()) {
           if (! affectedHosts.containsKey(hostname)) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java b/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java
index 54ce9ae..e0bfdcf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metadata/ActionMetadata.java
@@ -35,16 +35,16 @@ import com.google.inject.Singleton;
  */
 @Singleton
 public class ActionMetadata {
-  private final Map<String, List<String>> serviceActions = new HashMap<String, List<String>>();
-  private final Map<String, String> serviceClients = new HashMap<String, String>();
+  private final Map<String, List<String>> serviceActions = new HashMap<>();
+  private final Map<String, String> serviceClients = new HashMap<>();
   private final Map<String, String> serviceCheckActions =
-      new HashMap<String, String>();
-  private final List<String> defaultHostComponentCommands = new ArrayList<String>();
+    new HashMap<>();
+  private final List<String> defaultHostComponentCommands = new ArrayList<>();
   public final static String SERVICE_CHECK_POSTFIX = "_SERVICE_CHECK";
 
   private static final Map<String, String> SERVICE_CHECKS;
   static {
-      Map<String, String> serviceChecks = new HashMap<String, String>();
+      Map<String, String> serviceChecks = new HashMap<>();
 
       serviceChecks.put(Service.Type.ZOOKEEPER.toString(), "ZOOKEEPER_QUORUM_SERVICE_CHECK");
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java b/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
index 55a0035..36e1904 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metadata/AmbariServiceAlertDefinitions.java
@@ -105,7 +105,7 @@ public class AmbariServiceAlertDefinitions {
    *         component.
    */
   private List<AlertDefinition> getDefinitions(Components component) {
-    List<AlertDefinition> definitions = new ArrayList<AlertDefinition>();
+    List<AlertDefinition> definitions = new ArrayList<>();
 
     InputStream inputStream = ClassLoader.getSystemResourceAsStream("alerts.json");
     InputStreamReader reader = new InputStreamReader(inputStream);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java b/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
index 7a767bd..40ec0a1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java
@@ -190,10 +190,10 @@ public class RoleCommandOrder implements Cloneable {
   public Set<Service> getTransitiveServices(Service service, RoleCommand cmd)
     throws AmbariException {
 
-    Set<Service> transitiveServices = new HashSet<Service>();
+    Set<Service> transitiveServices = new HashSet<>();
     Cluster cluster = service.getCluster();
 
-    Set<RoleCommandPair> allDeps = new HashSet<RoleCommandPair>();
+    Set<RoleCommandPair> allDeps = new HashSet<>();
     for (ServiceComponent sc : service.getServiceComponents().values()) {
       RoleCommandPair rcp = new RoleCommandPair(Role.valueOf(sc.getName()), cmd);
       Set<RoleCommandPair> deps = dependencies.get(rcp);
@@ -221,8 +221,8 @@ public class RoleCommandOrder implements Cloneable {
    */
   private void extendTransitiveDependency() {
     for (Map.Entry<RoleCommandPair, Set<RoleCommandPair>> roleCommandPairSetEntry : dependencies.entrySet()) {
-      HashSet<RoleCommandPair> visited = new HashSet<RoleCommandPair>();
-      HashSet<RoleCommandPair> transitiveDependencies = new HashSet<RoleCommandPair>();
+      HashSet<RoleCommandPair> visited = new HashSet<>();
+      HashSet<RoleCommandPair> transitiveDependencies = new HashSet<>();
       for (RoleCommandPair directlyBlockedOn : dependencies.get(roleCommandPairSetEntry.getKey())) {
         visited.add(directlyBlockedOn);
         identifyTransitiveDependencies(directlyBlockedOn, visited, transitiveDependencies);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
index 8b53c10..f268149 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
@@ -123,7 +123,7 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements
         }
       }
 
-      Set<String> propertyIds = new HashSet<String>();
+      Set<String> propertyIds = new HashSet<>();
       propertyIds.add(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID);
 
       Predicate predicate = new PredicateBuilder().property(

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
index 52cc0a3..fcf4525 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariPerformanceMonitor.java
@@ -78,7 +78,7 @@ public class AmbariPerformanceMonitor extends PerformanceMonitor {
   public void dumpResults() {
 
     lastDumpTime = System.currentTimeMillis();
-    Set<String> operations = new TreeSet<String>(this.operationTimings.keySet());
+    Set<String> operations = new TreeSet<>(this.operationTimings.keySet());
     Map<String, Long> metrics = new HashMap<>();
 
     for (String operation : operations) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/notifications/DispatchFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/notifications/DispatchFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/notifications/DispatchFactory.java
index ce99121..994f381 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/notifications/DispatchFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/notifications/DispatchFactory.java
@@ -37,7 +37,7 @@ public class DispatchFactory {
   /**
    * Mapping of dispatch type to dispatcher singleton.
    */
-  private final Map<String, NotificationDispatcher> m_dispatchers = new HashMap<String, NotificationDispatcher>();
+  private final Map<String, NotificationDispatcher> m_dispatchers = new HashMap<>();
 
   /**
    * Constructor.

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java
index bdfe7a7..14a8928 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java
@@ -171,7 +171,7 @@ public class SNMPDispatcher implements NotificationDispatcher {
    */
   @Override
   public TargetConfigurationResult validateTargetConfig(Map<String, Object> properties) {
-    Map<String, String> stringValuesConfig = new HashMap<String, String>(properties.size());
+    Map<String, String> stringValuesConfig = new HashMap<>(properties.size());
     for (Map.Entry<String, Object> propertyEntry : properties.entrySet()) {
       stringValuesConfig.put(propertyEntry.getKey(), propertyEntry.getValue().toString());
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
index e19192a..d01e366 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
@@ -93,7 +93,7 @@ public class AmbariJpaLocalTxnInterceptor implements MethodInterceptor {
   private final UnitOfWork unitOfWork = null;
 
   // Tracks if the unit of work was begun implicitly by this transaction.
-  private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<Boolean>();
+  private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<>();
 
   /**
    * {@inheritDoc}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariLocalSessionInterceptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariLocalSessionInterceptor.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariLocalSessionInterceptor.java
index 32ada91..2a44c89 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariLocalSessionInterceptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariLocalSessionInterceptor.java
@@ -32,7 +32,7 @@ public class AmbariLocalSessionInterceptor implements MethodInterceptor {
   @Inject
   private final AmbariJpaPersistService emProvider = null;
 
-  private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<Boolean>();
+  private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<>();
 
   @Override
   public Object invoke(MethodInvocation invocation) throws Throwable {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
index e8c4b5f..d3ba2ac 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java
@@ -358,7 +358,7 @@ public class AlertsDAO implements Cleanable {
     }
 
     // sorting
-    JpaSortBuilder<AlertHistoryEntity> sortBuilder = new JpaSortBuilder<AlertHistoryEntity>();
+    JpaSortBuilder<AlertHistoryEntity> sortBuilder = new JpaSortBuilder<>();
     List<Order> sortOrders = sortBuilder.buildSortOrders(request.Sort, visitor);
     query.orderBy(sortOrders);
 
@@ -396,7 +396,7 @@ public class AlertsDAO implements Cleanable {
     }
 
     // sorting
-    JpaSortBuilder<AlertCurrentEntity> sortBuilder = new JpaSortBuilder<AlertCurrentEntity>();
+    JpaSortBuilder<AlertCurrentEntity> sortBuilder = new JpaSortBuilder<>();
     List<Order> sortOrders = sortBuilder.buildSortOrders(request.Sort, visitor);
     query.orderBy(sortOrders);
 
@@ -587,7 +587,7 @@ public class AlertsDAO implements Cleanable {
     query.setParameter("unknownState", AlertState.UNKNOWN);
     query.setParameter("maintenanceStateOff", MaintenanceState.OFF);
 
-    Map<String, AlertSummaryDTO> map = new HashMap<String, AlertSummaryDTO>();
+    Map<String, AlertSummaryDTO> map = new HashMap<>();
     List<HostAlertSummaryDTO> resultList = m_daoUtils.selectList(query);
     for (HostAlertSummaryDTO result : resultList) {
       map.put(result.getHostName(), result);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java
index 28b9fea..bb69f22 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ConfigGroupHostMappingDAO.java
@@ -80,7 +80,7 @@ public class ConfigGroupHostMappingDAO {
       try {
         if (!cacheLoaded) {
           if (configGroupHostMappingByHost == null) {
-            configGroupHostMappingByHost = new HashMap<Long, Set<ConfigGroupHostMapping>>();
+            configGroupHostMappingByHost = new HashMap<>();
 
             TypedQuery<ConfigGroupHostMappingEntity> query = entityManagerProvider.get().createQuery(
                 "SELECT entity FROM ConfigGroupHostMappingEntity entity",
@@ -93,7 +93,7 @@ public class ConfigGroupHostMappingDAO {
               Set<ConfigGroupHostMapping> setByHost = configGroupHostMappingByHost.get((configGroupHostMappingEntity.getHostId()));
 
               if (setByHost == null) {
-                setByHost = new HashSet<ConfigGroupHostMapping>();
+                setByHost = new HashSet<>();
                 configGroupHostMappingByHost.put(configGroupHostMappingEntity.getHostId(), setByHost);
               }
 
@@ -135,7 +135,7 @@ public class ConfigGroupHostMappingDAO {
       return null;
     }
 
-    Set<ConfigGroupHostMapping> set = new HashSet<ConfigGroupHostMapping>(configGroupHostMappingByHost.get(hostId));
+    Set<ConfigGroupHostMapping> set = new HashSet<>(configGroupHostMappingByHost.get(hostId));
 
     return set;
 
@@ -146,11 +146,11 @@ public class ConfigGroupHostMappingDAO {
 
     populateCache();
 
-    Set<ConfigGroupHostMapping> result = new HashSet<ConfigGroupHostMapping>();
+    Set<ConfigGroupHostMapping> result = new HashSet<>();
 
     for (Set<ConfigGroupHostMapping> item : configGroupHostMappingByHost.values()) {
 
-      Set<ConfigGroupHostMapping> setByHost = new HashSet<ConfigGroupHostMapping>(item);
+      Set<ConfigGroupHostMapping> setByHost = new HashSet<>(item);
 
       CollectionUtils.filter(setByHost, new Predicate() {
 
@@ -183,7 +183,7 @@ public class ConfigGroupHostMappingDAO {
     //create in cache
     Set<ConfigGroupHostMapping> set = configGroupHostMappingByHost.get(configGroupHostMappingEntity.getHostId());
     if (set == null){
-      set = new HashSet<ConfigGroupHostMapping>();
+      set = new HashSet<>();
       configGroupHostMappingByHost.put(configGroupHostMappingEntity.getHostId(), set);
     }
 
@@ -197,7 +197,7 @@ public class ConfigGroupHostMappingDAO {
 
     Set<ConfigGroupHostMapping> set = configGroupHostMappingByHost.get(configGroupHostMappingEntity.getHostId());
     if (set == null){
-      set = new HashSet<ConfigGroupHostMapping>();
+      set = new HashSet<>();
       configGroupHostMappingByHost.put(configGroupHostMappingEntity.getHostId(), set);
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8080350/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ExtensionLinkDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ExtensionLinkDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ExtensionLinkDAO.java
index adf7a04..e860c64 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ExtensionLinkDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ExtensionLinkDAO.java
@@ -66,7 +66,7 @@ public class ExtensionLinkDAO {
   public List<ExtensionLinkEntity> find(ExtensionLinkRequest request) {
     if (request.getLinkId() != null) {
       ExtensionLinkEntity entity = findById(new Long(request.getLinkId()));
-      List<ExtensionLinkEntity> list = new ArrayList<ExtensionLinkEntity>();
+      List<ExtensionLinkEntity> list = new ArrayList<>();
       list.add(entity);
       return list;
     }
@@ -79,7 +79,7 @@ public class ExtensionLinkDAO {
     if (stackName != null && stackVersion != null) {
       if (extensionName != null && extensionVersion != null) {
         ExtensionLinkEntity entity = findByStackAndExtension(stackName, stackVersion, extensionName, extensionVersion);
-        List<ExtensionLinkEntity> list = new ArrayList<ExtensionLinkEntity>();
+        List<ExtensionLinkEntity> list = new ArrayList<>();
         list.add(entity);
         return list;
       }


Mime
View raw message