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/backends/RootDSEBackend.java |   46 ++++++++++++++++------------------------------
 1 files changed, 16 insertions(+), 30 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
index e3f1387..43135bb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
@@ -166,7 +166,7 @@
       throw new ConfigException(message);
     }
 
-    userDefinedAttributes = new ArrayList<Attribute>();
+    userDefinedAttributes = new ArrayList<>();
     addAllUserDefinedAttrs(userDefinedAttributes, configEntry.getEntry());
 
 
@@ -189,7 +189,7 @@
       }
       else
       {
-        subordinateBaseDNs = new ConcurrentHashMap<DN, Backend<?>>();
+        subordinateBaseDNs = new ConcurrentHashMap<>();
         for (DN baseDN : subDNs)
         {
           Backend<?> backend = DirectoryServer.getBackend(baseDN);
@@ -221,19 +221,15 @@
 
     // Construct the set of "static" attributes that will always be present in
     // the root DSE.
-    staticDSEAttributes = new ArrayList<Attribute>();
-
-    staticDSEAttributes.add(Attributes.create(ATTR_VENDOR_NAME,
-                                            SERVER_VENDOR_NAME));
-
+    staticDSEAttributes = new ArrayList<>();
+    staticDSEAttributes.add(Attributes.create(ATTR_VENDOR_NAME, SERVER_VENDOR_NAME));
     staticDSEAttributes.add(Attributes.create(ATTR_VENDOR_VERSION,
                                  DirectoryServer.getVersionString()));
-
     staticDSEAttributes.add(Attributes.create("fullVendorVersion",
                                  BuildVersion.binaryVersion().toString()));
 
     // Construct the set of objectclasses to include in the root DSE entry.
-    dseObjectClasses = new HashMap<ObjectClass,String>(2);
+    dseObjectClasses = new HashMap<>(2);
     ObjectClass topOC = DirectoryServer.getObjectClass(OC_TOP);
     if (topOC == null)
     {
@@ -241,8 +237,7 @@
     }
     dseObjectClasses.put(topOC, OC_TOP);
 
-    ObjectClass rootDSEOC =
-         DirectoryServer.getObjectClass(OC_ROOT_DSE);
+    ObjectClass rootDSEOC = DirectoryServer.getObjectClass(OC_ROOT_DSE);
     if (rootDSEOC == null)
     {
       rootDSEOC = DirectoryServer.getDefaultObjectClass(OC_ROOT_DSE);
@@ -462,10 +457,8 @@
    */
   private Entry getRootDSE(ClientConnection connection)
   {
-    HashMap<AttributeType,List<Attribute>> dseUserAttrs =
-         new HashMap<AttributeType,List<Attribute>>();
-    HashMap<AttributeType,List<Attribute>> dseOperationalAttrs =
-         new HashMap<AttributeType,List<Attribute>>();
+    HashMap<AttributeType,List<Attribute>> dseUserAttrs = new HashMap<>();
+    HashMap<AttributeType,List<Attribute>> dseOperationalAttrs = new HashMap<>();
 
 
     Attribute publicNamingContextAttr = createDNAttribute(
@@ -473,7 +466,6 @@
         DirectoryServer.getPublicNamingContexts().keySet());
     addAttribute(publicNamingContextAttr, dseUserAttrs, dseOperationalAttrs);
 
-
     // Add the "ds-private-naming-contexts" attribute.
     Attribute privateNamingContextAttr = createDNAttribute(
         ATTR_PRIVATE_NAMING_CONTEXTS, ATTR_PRIVATE_NAMING_CONTEXTS,
@@ -496,27 +488,22 @@
         ATTR_SUPPORTED_FEATURE_LC, DirectoryServer.getSupportedFeatures());
     addAttribute(supportedFeatureAttr, dseUserAttrs, dseOperationalAttrs);
 
-
     // Add the "supportedSASLMechanisms" attribute.
     Attribute supportedSASLMechAttr = createAttribute(
         ATTR_SUPPORTED_SASL_MECHANISMS, ATTR_SUPPORTED_SASL_MECHANISMS_LC,
         DirectoryServer.getSupportedSASLMechanisms().keySet());
     addAttribute(supportedSASLMechAttr, dseUserAttrs, dseOperationalAttrs);
 
-
     // Add the "supportedLDAPVersions" attribute.
-    TreeSet<String> versionStrings = new TreeSet<String>();
+    TreeSet<String> versionStrings = new TreeSet<>();
     for (Integer ldapVersion : DirectoryServer.getSupportedLDAPVersions())
     {
       versionStrings.add(ldapVersion.toString());
     }
-    Attribute supportedLDAPVersionAttr =
-         createAttribute(ATTR_SUPPORTED_LDAP_VERSION,
-                         ATTR_SUPPORTED_LDAP_VERSION_LC,
-                         versionStrings);
+    Attribute supportedLDAPVersionAttr = createAttribute(
+        ATTR_SUPPORTED_LDAP_VERSION, ATTR_SUPPORTED_LDAP_VERSION_LC, versionStrings);
     addAttribute(supportedLDAPVersionAttr, dseUserAttrs, dseOperationalAttrs);
 
-
     // Add the "supportedAuthPasswordSchemes" attribute.
     Set<String> authPWSchemes =
          DirectoryServer.getAuthPasswordStorageSchemes().keySet();
@@ -525,8 +512,7 @@
       Attribute supportedAuthPWSchemesAttr =
            createAttribute(ATTR_SUPPORTED_AUTH_PW_SCHEMES,
                            ATTR_SUPPORTED_AUTH_PW_SCHEMES_LC, authPWSchemes);
-      ArrayList<Attribute> supportedAuthPWSchemesAttrs =
-           new ArrayList<Attribute>(1);
+      ArrayList<Attribute> supportedAuthPWSchemesAttrs = new ArrayList<>(1);
       supportedAuthPWSchemesAttrs.add(supportedAuthPWSchemesAttr);
       if (showAllAttributes
           || !supportedSASLMechAttr.getAttributeType().isOperational())
@@ -606,7 +592,7 @@
       List<Attribute> attrs = attrsMap.get(type);
       if (attrs == null)
       {
-        attrs = new ArrayList<Attribute>();
+        attrs = new ArrayList<>();
         attrsMap.put(type, attrs);
       }
       attrs.add(a);
@@ -621,7 +607,7 @@
   {
     if (!publicNamingContextAttr.isEmpty())
     {
-      List<Attribute> privateNamingContextAttrs = new ArrayList<Attribute>(1);
+      List<Attribute> privateNamingContextAttrs = new ArrayList<>(1);
       privateNamingContextAttrs.add(publicNamingContextAttr);
       final AttributeType attrType = publicNamingContextAttr.getAttributeType();
       if (showAllAttributes || !attrType.isOperational())
@@ -1049,7 +1035,7 @@
       }
       else
       {
-        subBases = new ConcurrentHashMap<DN, Backend<?>>();
+        subBases = new ConcurrentHashMap<>();
         for (DN baseDN : subDNs)
         {
           Backend<?> backend = DirectoryServer.getBackend(baseDN);
@@ -1082,7 +1068,7 @@
 
 
     // Check to see if there is a new set of user-defined attributes.
-    ArrayList<Attribute> userAttrs = new ArrayList<Attribute>();
+    ArrayList<Attribute> userAttrs = new ArrayList<>();
     try
     {
       ConfigEntry configEntry = DirectoryServer.getConfigEntry(configEntryDN);

--
Gitblit v1.10.0