directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [2/2] directory-fortress-core git commit: Used a StringBuilder instead of a StrungBuffer (no synchronization in a StringBuilder)
Date Tue, 19 May 2015 15:44:00 GMT
Used a StringBuilder instead of a StrungBuffer (no synchronization in a StringBuilder)


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

Branch: refs/heads/master
Commit: 99a6ab383de0d075fb66ce5ed058f526bb3e0475
Parents: 77efdc6 9bebe57
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Tue May 19 17:43:39 2015 +0200
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Tue May 19 17:43:39 2015 +0200

----------------------------------------------------------------------
 .../directory/fortress/core/rbac/UserDAO.java   | 156 ++++++++++++++-----
 .../fortress/core/util/time/ClockTime.java      |   2 +-
 2 files changed, 115 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/99a6ab38/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
index c634988,619a61b..2d4c660
--- a/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/rbac/UserDAO.java
@@@ -1234,8 -1178,11 +1254,11 @@@ final class UserDAO extends ApacheDsDat
          try
          {
              String roleVal = encodeSafeText( role.getName(), GlobalIds.USERID_LEN );
-             StringBuilder filter = new StringBuilder();
-             filter.append( GlobalIds.FILTER_PREFIX ).append( USERS_AUX_OBJECT_CLASS_NAME
).append( ")(" );
 -            StringBuffer filterbuf = new StringBuffer();
++            StringBuilder filterbuf = new StringBuilder();
+             filterbuf.append( GlobalIds.FILTER_PREFIX );
+             filterbuf.append( USERS_AUX_OBJECT_CLASS_NAME );
+             filterbuf.append( ")(" );
+ 
              Set<String> roles = RoleUtil.getDescendants( role.getName(), role.getContextId()
);
  
              if ( VUtil.isNotNullOrEmpty( roles ) )
@@@ -1302,12 -1258,18 +1334,18 @@@
          try
          {
              String roleVal = encodeSafeText( role.getName(), GlobalIds.USERID_LEN );
-             StringBuilder filter = new StringBuilder();
-             filter.append( GlobalIds.FILTER_PREFIX ).append( USERS_AUX_OBJECT_CLASS_NAME
).append( ")(" );
-             filter.append( GlobalIds.USER_ROLE_ASSIGN ).append( "=" ).append( roleVal ).append(
"))" );
 -            StringBuffer filterbuf = new StringBuffer();
++            StringBuilder filterbuf = new StringBuilder();
+             filterbuf.append( GlobalIds.FILTER_PREFIX );
+             filterbuf.append( USERS_AUX_OBJECT_CLASS_NAME );
+             filterbuf.append( ")(" );
+             filterbuf.append( GlobalIds.USER_ROLE_ASSIGN );
+             filterbuf.append( "=" );
+             filterbuf.append( roleVal );
+             filterbuf.append( "))" );
+ 
              ld = getAdminConnection();
-             SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filter.toString(),
DEFAULT_ATRS,
-                 false, GlobalIds.BATCH_SIZE );
+             SearchCursor searchResults = search( ld, userRoot, SearchScope.ONELEVEL, filterbuf.toString(),
DEFAULT_ATRS, false,
+                 GlobalIds.BATCH_SIZE );
              long sequence = 0;
  
              while ( searchResults.next() )
@@@ -2426,4 -2420,4 +2498,4 @@@
  
          return uRoles;
      }
--}
++}

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/99a6ab38/src/main/java/org/apache/directory/fortress/core/util/time/ClockTime.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/directory/fortress/core/util/time/ClockTime.java
index 95caf23,993953f..a6753f8
--- a/src/main/java/org/apache/directory/fortress/core/util/time/ClockTime.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/time/ClockTime.java
@@@ -81,7 -76,6 +81,7 @@@ public class ClockTim
                  }
              }
          }
 +
          return rc;
      }
--}
++}


Mime
View raw message