From 8b3cd28204e15e0a98ce038b355f100cd7c44e3c Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <capponi.nicolas@gmail.com>
Date: Thu, 28 Jan 2016 08:28:20 +0000
Subject: [PATCH] OPENDJ-1632 (PR-201) Migrate AttributeType in one shot

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
index fb3561e..dcd9877 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2008-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2015 ForgeRock AS
+ *      Portions Copyright 2011-2016 ForgeRock AS
  */
 
 package org.opends.guitools.controlpanel.ui;
@@ -57,7 +57,7 @@
 import org.opends.guitools.controlpanel.ui.nodes.BasicNode;
 import org.opends.guitools.controlpanel.util.Utilities;
 import org.opends.server.schema.SchemaConstants;
-import org.opends.server.types.AttributeType;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.types.Attributes;
 import org.opends.server.types.Entry;
 import org.opends.server.types.ObjectClass;
@@ -357,7 +357,7 @@
     {
       schemaReadOnlyAttributes.clear();
       schemaReadOnlyAttributesLowerCase.clear();
-      for (AttributeType attr : schema.getAttributeTypes().values())
+      for (AttributeType attr : schema.getAttributeTypes())
       {
         if (attr.isNoUserModification())
         {
@@ -487,10 +487,10 @@
     // Check all the attributes that we consider binaries.
     if (schema != null)
     {
-      AttributeType attr = schema.getAttributeType(
-          Utilities.getAttributeNameWithoutOptions(attrName).toLowerCase());
-      if (attr != null)
+      String attributeName = Utilities.getAttributeNameWithoutOptions(attrName).toLowerCase();
+      if (schema.hasAttributeType(attributeName))
       {
+        AttributeType attr = schema.getAttributeType(attributeName);
         Syntax syntax = attr.getSyntax();
         if (syntax != null)
         {
@@ -574,9 +574,9 @@
     attrName = Utilities.getAttributeNameWithoutOptions(attrName);
     if (schema != null)
     {
-      AttributeType attrType = schema.getAttributeType(attrName.toLowerCase());
-      if (attrType != null)
+      if (schema.hasAttributeType(attrName.toLowerCase()))
       {
+        AttributeType attrType = schema.getAttributeType(attrName.toLowerCase());
         isEditable = !attrType.isNoUserModification();
       }
     }

--
Gitblit v1.10.0