directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [67/75] [abbrv] directory-fortress-core git commit: FC-109 - remove unnecessary objutil methods
Date Tue, 09 Jun 2015 03:16:13 GMT
FC-109 - remove unnecessary objutil methods


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/ed93614f
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/ed93614f
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/ed93614f

Branch: refs/heads/master
Commit: ed93614fbb5169fba3a98c550953e860e7846eb5
Parents: 5942f62
Author: Shawn McKinney <smckinney@apache.org>
Authored: Thu Jun 4 09:45:42 2015 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Thu Jun 4 09:45:42 2015 -0500

----------------------------------------------------------------------
 .../directory/fortress/core/impl/RoleP.java     |  3 +--
 .../directory/fortress/core/impl/UserDAO.java   |  4 ++--
 .../directory/fortress/core/impl/UserP.java     |  4 ++--
 .../fortress/core/model/ConstraintUtil.java     |  7 +++---
 .../directory/fortress/core/util/ObjUtil.java   | 25 --------------------
 .../fortress/core/impl/UserTestData.java        |  1 -
 6 files changed, 8 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ed93614f/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java b/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
index 4c57b91..54c724f 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/RoleP.java
@@ -34,7 +34,6 @@ import org.apache.directory.fortress.core.model.Graphable;
 import org.apache.directory.fortress.core.model.Role;
 import org.apache.directory.fortress.core.model.UserRole;
 import org.apache.directory.fortress.core.util.VUtil;
-import org.apache.directory.fortress.core.util.ObjUtil;
 
 
 /**
@@ -278,7 +277,7 @@ final class RoleP
         {
             VUtil.description( entity.getDescription() );
         }
-        if ( ObjUtil.isNotNullOrEmpty( entity.getTimeout() ) )
+        if ( entity.getTimeout() != null )
         {
             constraintValidator.timeout( entity.getTimeout() );
         }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ed93614f/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
index 68afc4b..302b7f0 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
@@ -483,7 +483,7 @@ final class UserDAO extends ApacheDsDataProvider
             loadAttrs( entity.getEmails(), myEntry, SchemaConstants.MAIL_AT );
 
             // The following attributes are optional:
-            if ( ObjUtil.isNotNullOrEmpty( entity.isSystem() ) )
+            if ( entity.isSystem() != null )
             {
                 myEntry.add( SYSTEM_USER, entity.isSystem().toString().toUpperCase() );
             }
@@ -601,7 +601,7 @@ final class UserDAO extends ApacheDsDataProvider
                     szDn ) );
             }
 
-            if ( ObjUtil.isNotNullOrEmpty( entity.isSystem() ) )
+            if ( entity.isSystem() != null )
             {
                 mods.add( new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
SYSTEM_USER, entity
                     .isSystem().toString().toUpperCase() ) );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ed93614f/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserP.java b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
index a5cfe04..0786de9 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserP.java
@@ -323,7 +323,7 @@ final class UserP
         // Ensure this user isn't listed in Fortress config as a system user that can't be
removed via API.
         // Is there a match between this userId and a Fortress system user?
         User checkUser = read( user, true );
-        if ( ObjUtil.isNotNullOrEmpty( checkUser.isSystem() ) && checkUser.isSystem()
)
+        if ( checkUser.isSystem() != null && checkUser.isSystem() )
         {
             String warning = "softDelete userId [" + user.getUserId()
                 + "] can't be removed due to policy violation, rc=" + GlobalErrIds.USER_PLCY_VIOLATION;
@@ -348,7 +348,7 @@ final class UserP
         // Ensure this user isn't listed in Fortress config as a system user that can't be
removed via API.
         // Is there a match between this userId and a Fortress system user?
         User checkUser = read( user, true );
-        if ( ObjUtil.isNotNullOrEmpty( checkUser.isSystem() ) && checkUser.isSystem()
)
+        if ( checkUser.isSystem() != null && checkUser.isSystem() )
         {
             String warning = "delete userId [" + user.getUserId()
                 + "] can't be removed due to policy violation, rc=" + GlobalErrIds.USER_PLCY_VIOLATION;

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ed93614f/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java b/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
index a823c4f..bde06a4 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/ConstraintUtil.java
@@ -22,7 +22,6 @@ package org.apache.directory.fortress.core.model;
 import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.ValidationException;
-import org.apache.directory.fortress.core.util.ObjUtil;
 import org.apache.directory.fortress.core.util.VUtil;
 
 import java.util.StringTokenizer;
@@ -92,7 +91,7 @@ public class ConstraintUtil
     public static void validate( Constraint c1 )
         throws ValidationException
     {
-        if ( ObjUtil.isNotNullOrEmpty( c1.getTimeout() ) )
+        if ( c1.getTimeout() != null )
         {
             constraintValidator.timeout( c1.getTimeout() );
         }
@@ -285,11 +284,11 @@ public class ConstraintUtil
     public static void validateOrCopy( Constraint srcC, Constraint trgC )
         throws ValidationException
     {
-        if ( ObjUtil.isNotNullOrEmpty( trgC.getTimeout() ) )
+        if ( trgC.getTimeout() != null )
         {
             srcC.setTimeout( trgC.getTimeout() );
         }
-        else if ( ObjUtil.isNotNullOrEmpty( srcC.getTimeout() ) )
+        else if ( srcC.getTimeout() != null )
         {
             trgC.setTimeout( srcC.getTimeout() );
         }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ed93614f/src/main/java/org/apache/directory/fortress/core/util/ObjUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/ObjUtil.java b/src/main/java/org/apache/directory/fortress/core/util/ObjUtil.java
index fe667df..cec1cf6 100644
--- a/src/main/java/org/apache/directory/fortress/core/util/ObjUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/ObjUtil.java
@@ -20,7 +20,6 @@
 
 package org.apache.directory.fortress.core.util;
 
-import java.util.Collection;
 import java.util.Properties;
 
 /**
@@ -73,30 +72,6 @@ public final class ObjUtil
 
 
     /**
-     * Method will return true if input is not null or empty.
-     *
-     * @param iVal contains the reference to Integer variable.
-     * @return boolean if validation succeeds.
-     */
-    public static boolean isNotNullOrEmpty( Integer iVal )
-    {
-        return ( iVal != null );
-    }
-
-
-    /**
-     * Method will return true if input is not null or empty.
-     *
-     * @param bVal contains the reference to Boolean variable.
-     * @return boolean if validation succeeds.
-     */
-    public static boolean isNotNullOrEmpty( Boolean bVal )
-    {
-        return ( bVal != null );
-    }
-
-
-    /**
      * Method will return true if byte array reference is not null or empty.
      *
      * @param value contains the reference to byte array.

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ed93614f/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java b/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
index 4668ef2..ac5f93b 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/UserTestData.java
@@ -36,7 +36,6 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.model.Address;
 import org.apache.directory.fortress.core.model.User;
-import org.apache.directory.fortress.core.util.ObjUtil;
 import org.apache.directory.fortress.core.model.Constraint;
 
 


Mime
View raw message