jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1403440 - in /jackrabbit/branches/2.2: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/
Date Mon, 29 Oct 2012 17:34:26 GMT
Author: reschke
Date: Mon Oct 29 17:34:25 2012
New Revision: 1403440

URL: http://svn.apache.org/viewvc?rev=1403440&view=rev
Log:
JCR-3439: let PrincipalManagerImpl.CheckedGroup implement JackrabbitPrincipal (also improve
equals() method) (ported to 2.2)

Added:
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerTest.java
      - copied unchanged from r1403408, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerTest.java
Modified:
    jackrabbit/branches/2.2/   (props changed)
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerImpl.java
    jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/TestAll.java

Propchange: jackrabbit/branches/2.2/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1403408

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerImpl.java?rev=1403440&r1=1403439&r2=1403440&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerImpl.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalManagerImpl.java
Mon Oct 29 17:34:25 2012
@@ -28,6 +28,7 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.jackrabbit.api.security.principal.ItemBasedPrincipal;
+import org.apache.jackrabbit.api.security.principal.JackrabbitPrincipal;
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 
@@ -211,7 +212,7 @@ public class PrincipalManagerImpl implem
      * due to the fact, that the principal provider is not bound to a particular
      * Session object.
      */
-    private class CheckedGroup implements Group {
+    private class CheckedGroup implements Group, JackrabbitPrincipal {
 
         final Group delegatee;
         private final PrincipalProvider provider;
@@ -258,7 +259,7 @@ public class PrincipalManagerImpl implem
 
         @Override
         public boolean equals(Object obj) {
-            return delegatee.equals(obj);
+            return delegatee.equals(obj instanceof CheckedGroup ? ((CheckedGroup) obj).delegatee
: obj);
         }
     }
 

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/TestAll.java?rev=1403440&r1=1403439&r2=1403440&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/TestAll.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/principal/TestAll.java
Mon Oct 29 17:34:25 2012
@@ -37,7 +37,8 @@ public class TestAll extends TestCase {
 
         suite.addTestSuite(AbstractPrincipalProviderTest.class);
         suite.addTestSuite(EveryonePrincipalTest.class);
-        
+        suite.addTestSuite(PrincipalManagerTest.class);
+
         return suite;
     }
 }



Mime
View raw message