directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-commander git commit: FC-105 - [fortress-web] - redundant null check
Date Thu, 21 May 2015 12:17:00 GMT
Repository: directory-fortress-commander
Updated Branches:
  refs/heads/master 157183acb -> 4d75e768f


FC-105 - [fortress-web] - redundant null check


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/commit/4d75e768
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/tree/4d75e768
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/diff/4d75e768

Branch: refs/heads/master
Commit: 4d75e768f80a5e82be7159cb80064a96348d9771
Parents: 157183a
Author: Shawn McKinney <smckinney@apache.org>
Authored: Thu May 21 07:16:49 2015 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Thu May 21 07:16:49 2015 -0500

----------------------------------------------------------------------
 .../fortress/web/AuditAuthzListModel.java       |  4 ++--
 .../fortress/web/AuditBindListModel.java        |  8 +++----
 .../fortress/web/AuditModListModel.java         |  8 +++----
 .../directory/fortress/web/GroupListModel.java  | 24 +++++++++++++-------
 .../directory/fortress/web/OUListModel.java     | 12 +++++-----
 .../directory/fortress/web/ObjectListModel.java | 12 +++++-----
 .../directory/fortress/web/PermListModel.java   | 14 ++++++------
 .../fortress/web/PwPolicyListModel.java         | 12 +++++-----
 .../directory/fortress/web/RoleListModel.java   | 18 +++++++--------
 .../directory/fortress/web/SDListModel.java     | 14 ++++++------
 .../directory/fortress/web/UserListModel.java   | 16 ++++++-------
 11 files changed, 75 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/AuditAuthzListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/AuditAuthzListModel.java b/src/main/java/org/apache/directory/fortress/web/AuditAuthzListModel.java
index c814d4e..3dbb96f 100644
--- a/src/main/java/org/apache/directory/fortress/web/AuditAuthzListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/AuditAuthzListModel.java
@@ -85,7 +85,7 @@ public class AuditAuthzListModel extends Model<SerializableList<AuthZ>>
     {
         if (authZs != null)
         {
-            LOG.debug( ".getObject count: " + userAudit != null ? authZs.size() : "null"
);
+            LOG.debug( ".getObject count: " + authZs.size() );
             return authZs;
         }
         
@@ -140,7 +140,7 @@ public class AuditAuthzListModel extends Model<SerializableList<AuthZ>>
     @Override
     public void setObject( SerializableList<AuthZ> object )
     {
-        LOG.debug( ".setObject count: " + object != null ? object.size() : "null" );
+        LOG.debug( ".setObject count: " + object.size() );
         authZs = object;
     }
     

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/AuditBindListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/AuditBindListModel.java b/src/main/java/org/apache/directory/fortress/web/AuditBindListModel.java
index 62abc53..43969de 100644
--- a/src/main/java/org/apache/directory/fortress/web/AuditBindListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/AuditBindListModel.java
@@ -82,7 +82,7 @@ public class AuditBindListModel extends Model<SerializableList<Bind>>
     {
         if ( binds != null )
         {
-            LOG.debug( ".getObject count: " + userAudit != null ? binds.size() : "null" );
+            LOG.debug( ".getObject count: " + binds.size() );
             return binds;
         }
         
@@ -96,12 +96,12 @@ public class AuditBindListModel extends Model<SerializableList<Bind>>
            )
         {
             LOG.debug(".getObject null");
-            binds = new SerializableList<Bind>( new ArrayList<Bind>() );
+            binds = new SerializableList<>( new ArrayList<Bind>() );
         }
         else
         {
             // get the list of matching bind records from fortress:
-            binds = new SerializableList<Bind>( getList(userAudit) );
+            binds = new SerializableList<>( getList(userAudit) );
         }
         
         return binds;
@@ -111,7 +111,7 @@ public class AuditBindListModel extends Model<SerializableList<Bind>>
     @Override
     public void setObject( SerializableList<Bind> object )
     {
-        LOG.debug( ".setObject count: " + object != null ? object.size() : "null" );
+        LOG.debug( ".setObject count: " + object.size() );
         this.binds = object;
     }
     

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/AuditModListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/AuditModListModel.java b/src/main/java/org/apache/directory/fortress/web/AuditModListModel.java
index 48ad984..f9df463 100644
--- a/src/main/java/org/apache/directory/fortress/web/AuditModListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/AuditModListModel.java
@@ -84,7 +84,7 @@ public class AuditModListModel extends Model<SerializableList<Mod>>
     {
         if (mods != null)
         {
-            LOG.debug( ".getObject count: " + userAudit != null ? mods.size() : "null" );
+            LOG.debug( ".getObject count: " + mods.size() );
             return mods;
         }
         
@@ -100,7 +100,7 @@ public class AuditModListModel extends Model<SerializableList<Mod>>
            )
         {
             LOG.debug( ".getObject null" );
-            mods = new SerializableList<Mod>( new ArrayList<Mod>() );
+            mods = new SerializableList<>( new ArrayList<Mod>() );
         }
         else
         {
@@ -119,7 +119,7 @@ public class AuditModListModel extends Model<SerializableList<Mod>>
                 userAudit.setInternalUserId( user.getInternalId() );
             }
             
-            mods = new SerializableList<Mod>( getList( userAudit ) );
+            mods = new SerializableList<>( getList( userAudit ) );
         }
         
         return mods;
@@ -129,7 +129,7 @@ public class AuditModListModel extends Model<SerializableList<Mod>>
     @Override
     public void setObject( SerializableList<Mod> object )
     {
-        LOG.debug(".setObject count: " + object != null ? object.size() : "null");
+        LOG.debug(".setObject count: " + object.size() );
         this.mods = object;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/GroupListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/GroupListModel.java b/src/main/java/org/apache/directory/fortress/web/GroupListModel.java
index 803a98f..fb950bd 100644
--- a/src/main/java/org/apache/directory/fortress/web/GroupListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/GroupListModel.java
@@ -83,19 +83,27 @@ public class GroupListModel extends Model<SerializableList<Group>>
     {
         if ( groups != null )
         {
-            LOG.debug( ".getObject count: " + group != null ? groups.size() : "null" );
+            LOG.debug( ".getObject count: " + groups.size() );
             return groups;
         }
         
         if ( group == null )
         {
             LOG.debug( ".getObject null" );
-            groups = new SerializableList<Group>( new ArrayList<Group>() );
+            groups = new SerializableList<>( new ArrayList<Group>() );
         }
         else
         {
-            LOG.debug( ".getObject group name: " + group != null ? group.getName() : "null"
);
-            groups = new SerializableList<Group>( getList( group ) );
+            LOG.debug( ".getObject group name: " + group.getName() );
+            List<Group> foundGroups = getList( group );
+            if(VUtil.isNotNullOrEmpty( foundGroups ))
+            {
+                groups = new SerializableList<>( foundGroups );
+            }
+            else
+            {
+                groups = new SerializableList<>( new ArrayList<Group>() );
+            }
         }
         return groups;
     }
@@ -104,7 +112,7 @@ public class GroupListModel extends Model<SerializableList<Group>>
     @Override
     public void setObject( SerializableList<Group> object )
     {
-        LOG.debug(".setObject count: " + object != null ? object.size() : "null");
+        LOG.debug(".setObject count: " + object.size() );
         groups = object;
     }
     
@@ -127,18 +135,18 @@ public class GroupListModel extends Model<SerializableList<Group>>
             if ( VUtil.isNotNullOrEmpty( group.getMembers() ) )
             {
                 String userId = group.getMembers().get( 0 );
-                LOG.debug( ".getList group name: " + group != null ? group.getName() : "null"
);
+                LOG.debug( ".getList userId name: " + userId );
                 groupList = groupMgr.find( new User( userId ) );
             }
             else
             {
-                LOG.debug( ".getList group name: " + group != null ? group.getName() : "null"
);
+                LOG.debug( ".getList group name: " + group.getName() );
                 groupList = groupMgr.find( group );
             }
             // sort list by name:
             if( VUtil.isNotNullOrEmpty( groupList ))
             {
-                Collections.sort( ( List<Group> ) groupList, new Comparator<Group>()
+                Collections.sort( groupList, new Comparator<Group>()
                 {
                     @Override
                     public int compare(Group g1, Group g2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/OUListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/OUListModel.java b/src/main/java/org/apache/directory/fortress/web/OUListModel.java
index eace0da..fe427a5 100644
--- a/src/main/java/org/apache/directory/fortress/web/OUListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/OUListModel.java
@@ -82,19 +82,19 @@ public class OUListModel extends Model<SerializableList<OrgUnit>>
     {
         if ( orgUnits != null )
         {
-            LOG.debug( ".getObject count: " + orgUnit != null ? orgUnits.size() : "null"
);
+            LOG.debug( ".getObject count: " + orgUnits.size() );
             return orgUnits;
         }
         
         if ( orgUnit == null )
         {
             LOG.debug( ".getObject null" );
-            orgUnits = new SerializableList<OrgUnit>( new ArrayList<OrgUnit>()
);
+            orgUnits = new SerializableList<>( new ArrayList<OrgUnit>() );
         }
         else
         {
-            LOG.debug( ".getObject orgUnitNm: " + orgUnit != null ? orgUnit.getName() : "null"
);
-            orgUnits = new SerializableList<OrgUnit>( getList( orgUnit ) );
+            LOG.debug( ".getObject orgUnitNm: " + orgUnit.getName() );
+            orgUnits = new SerializableList<>( getList( orgUnit ) );
         }
         
         return orgUnits;
@@ -104,7 +104,7 @@ public class OUListModel extends Model<SerializableList<OrgUnit>>
     @Override
     public void setObject( SerializableList<OrgUnit> object )
     {
-        LOG.debug( ".setObject count: " + object != null ? ( ( List<OrgUnit> ) object
).size() : "null" );
+        LOG.debug( ".setObject count: " + ( object ).size() );
         orgUnits = object;
     }
     
@@ -130,7 +130,7 @@ public class OUListModel extends Model<SerializableList<OrgUnit>>
             // sort list by name:
             if( VUtil.isNotNullOrEmpty( orgUnitList ))
             {
-                Collections.sort( ( List<OrgUnit> ) orgUnitList, new Comparator<OrgUnit>()
+                Collections.sort( ( orgUnitList ), new Comparator<OrgUnit>()
                 {
                     @Override
                     public int compare(OrgUnit o1, OrgUnit o2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/ObjectListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/ObjectListModel.java b/src/main/java/org/apache/directory/fortress/web/ObjectListModel.java
index c8e7960..045cbbc 100644
--- a/src/main/java/org/apache/directory/fortress/web/ObjectListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/ObjectListModel.java
@@ -88,19 +88,19 @@ public class ObjectListModel extends Model<SerializableList<PermObj>>
     {
         if (permObjs != null)
         {
-            LOG.debug(".getObject count: " + permObj != null ? permObjs.size() : "null");
+            LOG.debug(".getObject count: " + permObjs.size() );
             return permObjs;
         }
         
         if (permObj == null)
         {
             LOG.debug(".getObject null");
-            permObjs = new SerializableList<PermObj>( new ArrayList<PermObj>());
+            permObjs = new SerializableList<>( new ArrayList<PermObj>());
         }
         else
         {
             LOG.debug(".getObject userId: " + permObj != null ? permObj.getObjName() : "null");
-            permObjs = new SerializableList<PermObj>( getList(permObj) );
+            permObjs = new SerializableList<>( getList(permObj) );
         }
         
         return permObjs;
@@ -110,7 +110,7 @@ public class ObjectListModel extends Model<SerializableList<PermObj>>
     @Override
     public void setObject(SerializableList<PermObj> object)
     {
-        LOG.debug(".setObject count: " + object != null ? object.size() : "null");
+        LOG.debug(".setObject count: " + object.size() );
         this.permObjs = object;
     }
 
@@ -130,7 +130,7 @@ public class ObjectListModel extends Model<SerializableList<PermObj>>
         
         try
         {
-            LOG.debug( ".getList permObjectName:" + permObj != null ? permObj.getObjName()
: "null" );
+            LOG.debug( ".getList permObjectName:" + permObj.getObjName() );
             
             String ou = permObj.getOu();
             
@@ -151,7 +151,7 @@ public class ObjectListModel extends Model<SerializableList<PermObj>>
             // sort list by objName:
             if( VUtil.isNotNullOrEmpty( permObjList ))
             {
-                Collections.sort( ( List<PermObj> ) permObjList, new Comparator<PermObj>()
+                Collections.sort( permObjList, new Comparator<PermObj>()
                 {
                     @Override
                     public int compare(PermObj p1, PermObj p2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/PermListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/PermListModel.java b/src/main/java/org/apache/directory/fortress/web/PermListModel.java
index 7d1b638..a18d8f4 100644
--- a/src/main/java/org/apache/directory/fortress/web/PermListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/PermListModel.java
@@ -82,7 +82,7 @@ public class PermListModel extends Model<SerializableList<Permission>>
     {
         if ( perms != null )
         {
-            LOG.debug( ".getObject count: " + perms != null ? perms.size() : "null" );
+            LOG.debug( ".getObject count: " + perms.size() );
             
             return perms;
         }
@@ -90,13 +90,13 @@ public class PermListModel extends Model<SerializableList<Permission>>
         if (perm == null)
         {
             LOG.debug( ".getObject null ");
-            perms = new SerializableList<Permission>( new ArrayList<Permission>()
);
+            perms = new SerializableList<>( new ArrayList<Permission>() );
         }
         else
         {
-            LOG.debug( " .getObject perm objectNm: " + perm != null ? perm.getObjName() :
"null" );
-            LOG.debug( " .getObject perm opNm: " + perm != null ? perm.getOpName() : "null"
);
-            perms = new SerializableList<Permission>( getList( perm ) );
+            LOG.debug( " .getObject perm objectNm: " + perm.getObjName() );
+            LOG.debug( " .getObject perm opNm: " + perm.getOpName() );
+            perms = new SerializableList<>( getList( perm ) );
         }
         
         return perms;
@@ -106,7 +106,7 @@ public class PermListModel extends Model<SerializableList<Permission>>
     @Override
     public void setObject( SerializableList<Permission> object )
     {
-        LOG.debug( ".setObject count: " + perms != null ? object.size() : "null" );
+        LOG.debug( ".setObject count: " + object.size() );
         this.perms = object;
     }
     
@@ -134,7 +134,7 @@ public class PermListModel extends Model<SerializableList<Permission>>
             // sort list by abstract name:
             if( VUtil.isNotNullOrEmpty( permsList ))
             {
-                Collections.sort( ( List<Permission> ) permsList, new Comparator<Permission>()
+                Collections.sort( permsList, new Comparator<Permission>()
                 {
                     @Override
                     public int compare(Permission p1, Permission p2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/PwPolicyListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/PwPolicyListModel.java b/src/main/java/org/apache/directory/fortress/web/PwPolicyListModel.java
index e2ee21b..fd35004 100644
--- a/src/main/java/org/apache/directory/fortress/web/PwPolicyListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/PwPolicyListModel.java
@@ -84,19 +84,19 @@ public class PwPolicyListModel extends Model<SerializableList<PwPolicy>>
     {
         if ( policies != null )
         {
-            LOG.debug( ".getObject count: " + policy != null ? policies.size() : "null" );
+            LOG.debug( ".getObject count: " + policies.size() );
             return policies;
         }
         
         if ( policy == null )
         {
             LOG.debug( ".getObject null" );
-            policies = new SerializableList<PwPolicy>( new ArrayList<PwPolicy>()
);
+            policies = new SerializableList<>( new ArrayList<PwPolicy>() );
         }
         else
         {
-            LOG.debug( ".getObject policyNm: " + policy != null ? policy.getName() : "null"
);
-            policies = new SerializableList<PwPolicy>( getList( policy ) );
+            LOG.debug( ".getObject policyNm: " + policy.getName() );
+            policies = new SerializableList<>( getList( policy ) );
         }
         
         return policies;
@@ -106,7 +106,7 @@ public class PwPolicyListModel extends Model<SerializableList<PwPolicy>>
     @Override
     public void setObject( SerializableList<PwPolicy> object )
     {
-        LOG.debug( ".setObject count: " + object != null ? ((List<PwPolicy>)object).size()
: "null" );
+        LOG.debug( ".setObject count: " + (object).size() );
         policies = object;
     }
     
@@ -131,7 +131,7 @@ public class PwPolicyListModel extends Model<SerializableList<PwPolicy>>
             // sort list by policy name:
             if( VUtil.isNotNullOrEmpty( policiesList ))
             {
-                Collections.sort( ( List<PwPolicy> ) policiesList, new Comparator<PwPolicy>()
+                Collections.sort( policiesList, new Comparator<PwPolicy>()
                 {
                     @Override
                     public int compare(PwPolicy p1, PwPolicy p2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/RoleListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/RoleListModel.java b/src/main/java/org/apache/directory/fortress/web/RoleListModel.java
index 721bf16..927a726 100644
--- a/src/main/java/org/apache/directory/fortress/web/RoleListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/RoleListModel.java
@@ -87,26 +87,26 @@ public class RoleListModel extends Model<SerializableList<? extends
Role>>
     {
         if ( roles != null )
         {
-            LOG.debug(".getObject count: " + role != null ? roles.size() : "null");
+            LOG.debug(".getObject count: " + roles.size() );
             return roles;
         }
         
         if ( role == null )
         {
             LOG.debug(".getObject null");
-            roles = new SerializableList<Role>( new ArrayList<Role>() );
+            roles = new SerializableList<>( new ArrayList<Role>() );
         }
         else
         {
-            LOG.debug(".getObject roleNm: " + role != null ? role.getName() : "null");
+            LOG.debug(".getObject roleNm: " + role.getName() );
             
             if ( isAdmin )
             {
-                roles = new SerializableList<AdminRole>( getAdminList( ( (AdminRole)role
).getName() ) );
+                roles = new SerializableList<>( getAdminList( ( role ).getName() )
);
             }
             else
             {
-                roles = new SerializableList<Role>( getList( role.getName() ) );
+                roles = new SerializableList<>( getList( role.getName() ) );
             }
         }
         
@@ -117,7 +117,7 @@ public class RoleListModel extends Model<SerializableList<? extends
Role>>
     @Override
     public void setObject( SerializableList<? extends Role> object )
     {
-        LOG.debug(".setObject count: " + object != null ? object.size() : "null");
+        LOG.debug(".setObject count: " + object.size() );
         this.roles = object;
     }
     
@@ -142,7 +142,7 @@ public class RoleListModel extends Model<SerializableList<? extends
Role>>
             // sort list by role name:
             if( VUtil.isNotNullOrEmpty( rolesList ))
             {
-                Collections.sort( ( List<Role> ) rolesList, new Comparator<Role>()
+                Collections.sort( rolesList, new Comparator<Role>()
                 {
                     @Override
                     public int compare(Role r1, Role r2)
@@ -169,10 +169,10 @@ public class RoleListModel extends Model<SerializableList<? extends
Role>>
         try
         {
             LOG.debug( ".getList roleNm: " + szRoleNm );
-            rolesList = (List<AdminRole>)delReviewMgr.findRoles( szRoleNm );
+            rolesList = delReviewMgr.findRoles( szRoleNm );
             if( VUtil.isNotNullOrEmpty( rolesList ))
             {
-                Collections.sort( ( List<AdminRole> ) rolesList, new Comparator<AdminRole>()
+                Collections.sort( rolesList, new Comparator<AdminRole>()
                 {
                     @Override
                     public int compare(AdminRole r1, AdminRole r2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/SDListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/SDListModel.java b/src/main/java/org/apache/directory/fortress/web/SDListModel.java
index 65b5949..e3fc4a4 100644
--- a/src/main/java/org/apache/directory/fortress/web/SDListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/SDListModel.java
@@ -83,19 +83,19 @@ public class SDListModel extends Model<SerializableList<SDSet>>
     {
         if ( sdSets != null )
         {
-            LOG.debug( ".getObject count: " + sdSet != null ? sdSets.size() : "null" );
+            LOG.debug( ".getObject count: " + sdSets.size() );
             return sdSets;
         }
         
         if ( sdSet == null )
         {
             LOG.debug( ".getObject null" );
-            sdSets = new SerializableList<SDSet>( new ArrayList<SDSet>() );
+            sdSets = new SerializableList<>( new ArrayList<SDSet>() );
         }
         else
         {
-            LOG.debug( ".getObject sdSetNm: " + sdSet != null ? sdSet.getName() : "null"
);
-            sdSets = new SerializableList<SDSet>( getList( sdSet ) );
+            LOG.debug( ".getObject sdSetNm: " + sdSet.getName() );
+            sdSets = new SerializableList<>( getList( sdSet ) );
         }
         
         return sdSets;
@@ -105,7 +105,7 @@ public class SDListModel extends Model<SerializableList<SDSet>>
     @Override
     public void setObject( SerializableList<SDSet> object )
     {
-        LOG.debug( ".setObject count: " + object != null ? object.size() : "null" );
+        LOG.debug( ".setObject count: " + object.size() );
         sdSets = object;
     }
     
@@ -127,7 +127,7 @@ public class SDListModel extends Model<SerializableList<SDSet>>
         {
             String szSdSetNm = sdSet != null && sdSet.getName() != null ? sdSet.getName()
: "";
             LOG.debug( ".getList sdSetNm: " + szSdSetNm );
-        
+
             if ( VUtil.isNotNullOrEmpty( sdSet.getMembers() ) )
             {
                 Object[] roleNms = sdSet.getMembers().toArray();
@@ -157,7 +157,7 @@ public class SDListModel extends Model<SerializableList<SDSet>>
             // sort list by set name:
             if( VUtil.isNotNullOrEmpty( sdSetList ))
             {
-                Collections.sort( ( List<SDSet> ) sdSetList, new Comparator<SDSet>()
+                Collections.sort( sdSetList, new Comparator<SDSet>()
                 {
                     @Override
                     public int compare(SDSet s1, SDSet s2)

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/4d75e768/src/main/java/org/apache/directory/fortress/web/UserListModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/UserListModel.java b/src/main/java/org/apache/directory/fortress/web/UserListModel.java
index 97d5638..6fff40e 100644
--- a/src/main/java/org/apache/directory/fortress/web/UserListModel.java
+++ b/src/main/java/org/apache/directory/fortress/web/UserListModel.java
@@ -77,7 +77,7 @@ public class UserListModel extends Model<SerializableList<User>>
     {
         this.user = user;
         init( session );
-        log.debug( "constructor userId: " + user != null ? user.getUserId() : "null" );
+        log.debug( "constructor userId: " + user.getUserId() );
     }
 
     
@@ -85,7 +85,7 @@ public class UserListModel extends Model<SerializableList<User>>
     {
         this.perm = perm;
         init( session );
-        log.debug( "constructor perm: " + perm != null ? perm.getObjName() : "null" );
+        log.debug( "constructor perm: " + perm.getObjName() );
     }
     
 
@@ -106,19 +106,19 @@ public class UserListModel extends Model<SerializableList<User>>
     {
         if (users != null)
         {
-            log.debug( ".getObject count: " + user != null ? users.size() : "null" );
+            log.debug( ".getObject count: " + users.size() );
             return users;
         }
         
         if ( ( user == null ) && ( perm == null  ))
         {
             log.debug( ".getObject null" );
-            users = new SerializableList<User>( new ArrayList<User>() );
+            users = new SerializableList<>( new ArrayList<User>() );
         }
         else
         {
             //log.debug(".getObject userId: " + user != null ? user.getUserId() : "null");
-            users = new SerializableList<User>( getList( user ) );
+            users = new SerializableList<>( getList( user ) );
         }
         
         return users;
@@ -128,7 +128,7 @@ public class UserListModel extends Model<SerializableList<User>>
     @Override
     public void setObject( SerializableList<User> object )
     {
-        log.debug(".setObject count: " + object != null ? object.size() : "null");
+        log.debug(".setObject count: " + object.size() );
         users = object;
     }
     
@@ -154,7 +154,7 @@ public class UserListModel extends Model<SerializableList<User>>
                 
                 if ( VUtil.isNotNullOrEmpty( users ) )
                 {
-                    usersList = new ArrayList<User>();
+                    usersList = new ArrayList<>();
                     
                     for(String userId : users)
                     {
@@ -182,7 +182,7 @@ public class UserListModel extends Model<SerializableList<User>>
             // sort list by userId:
             if( VUtil.isNotNullOrEmpty( usersList ))
             {
-                Collections.sort( ( List<User> ) usersList, new Comparator<User>()
+                Collections.sort( usersList, new Comparator<User>()
                 {
                     @Override
                     public int compare(User u1, User u2)


Mime
View raw message