From 90a6ab6c63699343acf3adcd4346bce2f5665bdd Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 07 Jul 2015 15:12:28 +0000
Subject: [PATCH] AutoRefactor'ed Use Diamond Operator

---
 opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java |   32 ++++++++++++--------------------
 1 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java b/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
index 71b8a4f..eba058b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
@@ -179,11 +179,9 @@
     {
         this.configEntryDN = configEntryDN;
 
-        alertGenerators = new CopyOnWriteArrayList<AlertGenerator>();
-        invokableComponents = new CopyOnWriteArrayList<InvokableComponent>();
-        monitorProviders =
-             new CopyOnWriteArrayList<MonitorProvider<
-                                           ? extends MonitorProviderCfg>>();
+        alertGenerators = new CopyOnWriteArrayList<>();
+        invokableComponents = new CopyOnWriteArrayList<>();
+        monitorProviders = new CopyOnWriteArrayList<>();
 
         MBeanServer mBeanServer = DirectoryServer.getJMXMBeanServer();
         if (mBeanServer != null)
@@ -423,7 +421,7 @@
 
           if (iterator.hasNext())
           {
-            List<String> stringValues = new ArrayList<String>();
+            List<String> stringValues = new ArrayList<>();
             stringValues.add(value.toString());
 
             while (iterator.hasNext())
@@ -615,7 +613,7 @@
 
             if (iterator.hasNext())
             {
-              List<String> stringValues = new ArrayList<String>();
+              List<String> stringValues = new ArrayList<>();
               stringValues.add(value.toString());
 
               while (iterator.hasNext())
@@ -749,9 +747,8 @@
       return new MBeanInfo(CLASS_NAME, null, null, null, null, null);
     }
 
-    List<MBeanAttributeInfo> attrs = new ArrayList<MBeanAttributeInfo>();
-    for (MonitorProvider<? extends MonitorProviderCfg> monitor :
-         monitorProviders)
+    List<MBeanAttributeInfo> attrs = new ArrayList<>();
+    for (MonitorProvider<? extends MonitorProviderCfg> monitor : monitorProviders)
     {
       for (org.opends.server.types.Attribute a : monitor.getMonitorData())
       {
@@ -760,12 +757,9 @@
       }
     }
 
-    MBeanAttributeInfo[] mBeanAttributes = new MBeanAttributeInfo[attrs.size()];
-    attrs.toArray(mBeanAttributes);
+    MBeanAttributeInfo[] mBeanAttributes = attrs.toArray(new MBeanAttributeInfo[attrs.size()]);
 
-
-    List<MBeanNotificationInfo> notifications =
-         new ArrayList<MBeanNotificationInfo>();
+    List<MBeanNotificationInfo> notifications = new ArrayList<>();
     for (AlertGenerator generator : alertGenerators)
     {
       String className = generator.getClassName();
@@ -775,18 +769,16 @@
       {
         String[] types       = { type };
         String   description = alerts.get(type);
-        notifications.add(new MBeanNotificationInfo(types, className,
-                                                    description));
+        notifications.add(new MBeanNotificationInfo(types, className, description));
       }
     }
 
 
-    MBeanNotificationInfo[] mBeanNotifications =
-         new MBeanNotificationInfo[notifications.size()];
+    MBeanNotificationInfo[] mBeanNotifications = new MBeanNotificationInfo[notifications.size()];
     notifications.toArray(mBeanNotifications);
 
 
-    List<MBeanOperationInfo> ops = new ArrayList<MBeanOperationInfo>();
+    List<MBeanOperationInfo> ops = new ArrayList<>();
     for (InvokableComponent component : invokableComponents)
     {
       for (InvokableMethod method : component.getOperationSignatures())

--
Gitblit v1.10.0