From a89f7014aeb71dba5c94404dfea7eb89e7eeee74 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 08 Jul 2015 06:48:02 +0000
Subject: [PATCH] AutoRefactor'ed Use Diamond Operator

---
 opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java |   41 +++++++++++------------------------------
 1 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
index 7a69ae3..c117fc0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateEntry.java
@@ -48,10 +48,8 @@
 {
   /** The branch used to generate this entry (if it is associated with a branch). */
   private Branch branch;
-
   /** The DN for this template entry, if it is known. */
   private DN dn;
-
   /** The DN of the parent entry for this template entry, if it is available. */
   private DN parentDN;
 
@@ -59,16 +57,12 @@
    * The set of attributes associated with this template entry, mapped from the
    * lowercase name of the attribute to the list of generated values.
    */
-  private LinkedHashMap<AttributeType,ArrayList<TemplateValue>> attributes;
+  private final LinkedHashMap<AttributeType, ArrayList<TemplateValue>> attributes = new LinkedHashMap<>();
 
-  /**
-   * The template used to generate this entry (if it is associated with a
-   * template).
-   */
+  /** The template used to generate this entry (if it is associated with a template). */
   private Template template;
 
 
-
   /**
    * Creates a new template entry that will be associated with the provided
    * branch.
@@ -80,9 +74,6 @@
     this.branch = branch;
 
     dn         = branch.getBranchDN();
-    template   = null;
-    parentDN   = null;
-    attributes = new LinkedHashMap<AttributeType,ArrayList<TemplateValue>>();
   }
 
 
@@ -98,10 +89,6 @@
   {
     this.template = template;
     this.parentDN = parentDN;
-
-    dn         = null;
-    branch     = null;
-    attributes = new LinkedHashMap<AttributeType,ArrayList<TemplateValue>>();
   }
 
 
@@ -257,11 +244,10 @@
    */
   public void addValue(TemplateValue value)
   {
-    ArrayList<TemplateValue> valueList =
-         attributes.get(value.getAttributeType());
+    ArrayList<TemplateValue> valueList = attributes.get(value.getAttributeType());
     if (valueList == null)
     {
-      valueList = new ArrayList<TemplateValue>();
+      valueList = new ArrayList<>();
       attributes.put(value.getAttributeType(), valueList);
     }
     valueList.add(value);
@@ -287,17 +273,12 @@
   public boolean toLDIF(LDIFExportConfig exportConfig)
          throws IOException, LDIFException
   {
-//  Process all of the attributes for this entry.
-    LinkedHashMap<ObjectClass,String> objectClasses =
-         new LinkedHashMap<ObjectClass,String>();
-    LinkedHashMap<AttributeType,List<Attribute>> userAttributes =
-         new LinkedHashMap<AttributeType,List<Attribute>>();
-    LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes =
-         new LinkedHashMap<AttributeType,List<Attribute>>();
-    LinkedHashMap<AttributeType, List<Attribute>> urlAttributes =
-         new LinkedHashMap<AttributeType, List<Attribute>>();
-    LinkedHashMap<AttributeType, List<Attribute>> base64Attributes =
-      new LinkedHashMap<AttributeType, List<Attribute>>();
+    // Process all of the attributes for this entry.
+    LinkedHashMap<ObjectClass,String> objectClasses = new LinkedHashMap<>();
+    LinkedHashMap<AttributeType,List<Attribute>> userAttributes = new LinkedHashMap<>();
+    LinkedHashMap<AttributeType,List<Attribute>> operationalAttributes = new LinkedHashMap<>();
+    LinkedHashMap<AttributeType, List<Attribute>> urlAttributes = new LinkedHashMap<>();
+    LinkedHashMap<AttributeType, List<Attribute>> base64Attributes = new LinkedHashMap<>();
 
     for (AttributeType t : attributes.keySet())
     {
@@ -490,7 +471,7 @@
 
   private ArrayList<Attribute> asList(AttributeBuilder builder)
   {
-    ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
+    ArrayList<Attribute> attrList = new ArrayList<>(1);
     attrList.add(builder.toAttribute());
     return attrList;
   }

--
Gitblit v1.10.0