From 8cdc460410cbf823ab0fede5d27856331aa3c1cf Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 18 Apr 2016 15:59:21 +0000
Subject: [PATCH] Added generic types

---
 opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
index 79b2f4f..37d4be1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -59,7 +59,6 @@
 import org.opends.server.types.LDIFImportConfig;
 import org.opends.server.types.SubEntry;
 import org.opends.server.util.SchemaUtils;
-import org.opends.server.util.SchemaUtils.PasswordType;
 
 /**
  * This class implements a Directory Server plugin that performs various
@@ -222,7 +221,7 @@
   }
 
   @Override
-  public void processImportBegin(Backend backend, LDIFImportConfig config)
+  public void processImportBegin(Backend<?> backend, LDIFImportConfig config)
   {
     // Find the set of attribute types with the auth password and user password
     // syntax defined in the schema.
@@ -230,14 +229,15 @@
     HashSet<AttributeType> userPWTypes = new HashSet<>();
     for (AttributeType t : DirectoryServer.getAttributeTypes())
     {
-      final PasswordType passwordType = SchemaUtils.checkPasswordType(t);
-      if (passwordType.equals(PasswordType.AUTH_PASSWORD))
+      switch (SchemaUtils.checkPasswordType(t))
       {
+      case AUTH_PASSWORD:
         authPWTypes.add(t);
-      }
-      else if (passwordType.equals(PasswordType.USER_PASSWORD))
-      {
+        break;
+
+      case USER_PASSWORD:
         userPWTypes.add(t);
+        break;
       }
     }
 
@@ -269,8 +269,7 @@
   }
 
   @Override
-  public void processImportEnd(Backend backend, LDIFImportConfig config,
-                               boolean successful)
+  public void processImportEnd(Backend<?> backend, LDIFImportConfig config, boolean successful)
   {
     // No implementation is required.
   }

--
Gitblit v1.10.0