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/admin/client/spi/AbstractManagedObject.java |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/AbstractManagedObject.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/AbstractManagedObject.java
index e3463ad..541a880 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/AbstractManagedObject.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/client/spi/AbstractManagedObject.java
@@ -285,7 +285,7 @@
       OperationRejectedException, AuthorizationException,
       CommunicationException {
     // First make sure all mandatory properties are defined.
-    List<PropertyException> exceptions = new LinkedList<PropertyException>();
+    List<PropertyException> exceptions = new LinkedList<>();
 
     for (PropertyDefinition<?> pd : definition.getAllPropertyDefinitions()) {
       Property<?> p = getProperty(pd);
@@ -301,7 +301,7 @@
     }
 
     // Now enforce any constraints.
-    List<LocalizableMessage> messages = new LinkedList<LocalizableMessage>();
+    List<LocalizableMessage> messages = new LinkedList<>();
     boolean isAcceptable = true;
     ManagementContext context = getDriver().getManagementContext();
 
@@ -525,7 +525,7 @@
   /** {@inheritDoc} */
   public final <PD> SortedSet<PD> getPropertyDefaultValues(
       PropertyDefinition<PD> pd) throws IllegalArgumentException {
-    return new TreeSet<PD>(getProperty(pd).getDefaultValues());
+    return new TreeSet<>(getProperty(pd).getDefaultValues());
   }
 
 
@@ -534,11 +534,10 @@
   public final <PD> PD getPropertyValue(PropertyDefinition<PD> pd)
       throws IllegalArgumentException {
     Set<PD> values = getProperty(pd).getEffectiveValues();
-    if (values.isEmpty()) {
-      return null;
-    } else {
+    if (!values.isEmpty()) {
       return values.iterator().next();
     }
+    return null;
   }
 
 
@@ -546,7 +545,7 @@
   /** {@inheritDoc} */
   public final <PD> SortedSet<PD> getPropertyValues(PropertyDefinition<PD> pd)
       throws IllegalArgumentException {
-    return new TreeSet<PD>(getProperty(pd).getEffectiveValues());
+    return new TreeSet<>(getProperty(pd).getEffectiveValues());
   }
 
 

--
Gitblit v1.10.0