directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-105 - [fortress-core] - enable dead code
Date Fri, 22 May 2015 13:41:00 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 06a32b109 -> 1addda759


FC-105 - [fortress-core] - enable dead code


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/1addda75
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/1addda75
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/1addda75

Branch: refs/heads/master
Commit: 1addda75904d8305e62e91fd3706fe4aaf823b1b
Parents: 06a32b1
Author: Shawn McKinney <smckinney@apache.org>
Authored: Fri May 22 08:40:54 2015 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Fri May 22 08:40:54 2015 -0500

----------------------------------------------------------------------
 .../core/ldap/container/OrganizationalUnitP.java        | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/1addda75/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitP.java
b/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitP.java
index d296868..a3f9014 100755
--- a/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitP.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/container/OrganizationalUnitP.java
@@ -73,6 +73,7 @@ public class OrganizationalUnitP
     public final void add( OrganizationalUnit orgUnit )
         throws SecurityException
     {
+        validate( orgUnit );
         OrganizationalUnitDAO oDao = new OrganizationalUnitDAO();
         oDao.create( orgUnit );
     }
@@ -126,7 +127,7 @@ public class OrganizationalUnitP
             throw new ValidationException( GlobalErrIds.CNTR_NAME_NULL, error );
         }
         
-        if ( entity.getParent().length() > GlobalIds.OU_LEN )
+        if ( entity.getParent() != null && entity.getParent().length() > GlobalIds.OU_LEN
)
         {
             String name = entity.getName();
             String error = "validate parent [" + name + "] invalid length [" + entity.getName().length()
@@ -135,15 +136,6 @@ public class OrganizationalUnitP
             throw new ValidationException( GlobalErrIds.CNTR_PARENT_INVLD, error );
         }
         
-        if ( !VUtil.isNotNullOrEmpty( entity.getParent() ) )
-        {
-            String error = "validate parent validation failed, null or empty value";
-            LOG.warn( error );
-            throw new ValidationException( GlobalErrIds.CNTR_PARENT_NULL, error );
-        }
-        
-        VUtil.safeText( entity.getDescription(), GlobalIds.DESC_LEN );
-        
         if ( VUtil.isNotNullOrEmpty( entity.getDescription() ) )
         {
             VUtil.description( entity.getDescription() );


Mime
View raw message