You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/10/03 00:01:34 UTC

svn commit: r1003897 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java

Author: elecharny
Date: Sat Oct  2 22:01:34 2010
New Revision: 1003897

URL: http://svn.apache.org/viewvc?rev=1003897&view=rev
Log:
o Fixed some findbugs issues

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java?rev=1003897&r1=1003896&r2=1003897&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java Sat Oct  2 22:01:34 2010
@@ -112,7 +112,7 @@ public class DefaultEntry implements Ent
         dn = DN.EMPTY_DN;
 
         // Initialize the ObjectClass object
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
     }
 
 
@@ -141,6 +141,8 @@ public class DefaultEntry implements Ent
      */
     public DefaultEntry( SchemaManager schemaManager, DN dn )
     {
+        this.schemaManager = schemaManager;
+
         if ( dn == null )
         {
             this.dn = DN.EMPTY_DN;
@@ -148,14 +150,11 @@ public class DefaultEntry implements Ent
         else
         {
             this.dn = dn;
+            normalizeDN( this.dn );
         }
 
-        this.schemaManager = schemaManager;
-
-        normalizeDN( dn );
-
         // Initialize the ObjectClass object
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
     }
 
 
@@ -195,20 +194,19 @@ public class DefaultEntry implements Ent
         this.schemaManager = schemaManager;
 
         // Initialize the ObjectClass object
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
 
         // We will clone the existing entry, because it may be normalized
         if ( entry.getDn() != null )
         {
             dn = entry.getDn();
+            normalizeDN( dn );
         }
         else
         {
             dn = DN.EMPTY_DN;
         }
 
-        normalizeDN( dn );
-
         // Init the attributes map
         attributes = new HashMap<String, EntryAttribute>( entry.size() );
 
@@ -255,6 +253,8 @@ public class DefaultEntry implements Ent
      */
     public DefaultEntry( SchemaManager schemaManager, DN dn, String... upIds )
     {
+        this.schemaManager = schemaManager;
+
         if ( dn == null )
         {
             this.dn = DN.EMPTY_DN;
@@ -262,13 +262,10 @@ public class DefaultEntry implements Ent
         else
         {
             this.dn = dn;
+            normalizeDN( this.dn );
         }
 
-        this.schemaManager = schemaManager;
-
-        normalizeDN( dn );
-
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
 
         set( upIds );
     }
@@ -315,6 +312,8 @@ public class DefaultEntry implements Ent
      */
     public DefaultEntry( SchemaManager schemaManager, DN dn, EntryAttribute... attributes )
     {
+        this.schemaManager = schemaManager;
+
         if ( dn == null )
         {
             this.dn = DN.EMPTY_DN;
@@ -322,13 +321,10 @@ public class DefaultEntry implements Ent
         else
         {
             this.dn = dn;
+            normalizeDN( this.dn );
         }
 
-        this.schemaManager = schemaManager;
-
-        normalizeDN( dn );
-
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
 
         for ( EntryAttribute attribute : attributes )
         {
@@ -364,6 +360,8 @@ public class DefaultEntry implements Ent
      */
     public DefaultEntry( SchemaManager schemaManager, DN dn, AttributeType... attributeTypes )
     {
+        this.schemaManager = schemaManager;
+
         if ( dn == null )
         {
             this.dn = DN.EMPTY_DN;
@@ -371,14 +369,11 @@ public class DefaultEntry implements Ent
         else
         {
             this.dn = dn;
+            normalizeDN( this.dn );
         }
 
-        this.schemaManager = schemaManager;
-
-        normalizeDN( dn );
-
         // Initialize the ObjectClass object
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
 
         // Add the attributeTypes
         set( attributeTypes );
@@ -408,6 +403,8 @@ public class DefaultEntry implements Ent
      */
     public DefaultEntry( SchemaManager schemaManager, DN dn, AttributeType attributeType, String upId )
     {
+        this.schemaManager = schemaManager;
+
         if ( dn == null )
         {
             this.dn = DN.EMPTY_DN;
@@ -415,14 +412,11 @@ public class DefaultEntry implements Ent
         else
         {
             this.dn = dn;
+            normalizeDN( dn );
         }
 
-        this.schemaManager = schemaManager;
-
-        normalizeDN( dn );
-
         // Initialize the ObjectClass object
-        initObjectClassAT( schemaManager );
+        initObjectClassAT();
 
         try
         {
@@ -452,7 +446,7 @@ public class DefaultEntry implements Ent
      */
     // This will suppress PMD.EmptyCatchBlock warnings in this method
     @SuppressWarnings("PMD.EmptyCatchBlock")
-    private void initObjectClassAT( SchemaManager schemaManager )
+    private void initObjectClassAT()
     {
         try
         {
@@ -471,7 +465,7 @@ public class DefaultEntry implements Ent
     }
 
 
-    private String getId( String upId ) throws IllegalArgumentException
+    private String getId( String upId )
     {
         String id = StringTools.trim( StringTools.toLowerCase( upId ) );
 
@@ -489,8 +483,10 @@ public class DefaultEntry implements Ent
 
     /**
      * Get the UpId if it was null.
+     * 
+     * @param upId The ID
      */
-    public static String getUpId( String upId, AttributeType attributeType )
+    private static String getUpId( String upId, AttributeType attributeType )
     {
         String normUpId = StringTools.trim( upId );