jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1436500 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/security/principal/ main/java/org/apache/jackrabbit/oak/security/user/ test/java/org/apache/jackrabbit/oak/security/principal/
Date Mon, 21 Jan 2013 17:27:25 GMT
Author: angela
Date: Mon Jan 21 17:27:24 2013
New Revision: 1436500

URL: http://svn.apache.org/viewvc?rev=1436500&view=rev
Log:
OAK-50 : Implement User Management
OAK-90 : Principal Management

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalImplTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalImpl.java?rev=1436500&r1=1436499&r2=1436500&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalImpl.java
Mon Jan 21 17:27:24 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.oak.security.principal;
 
-import java.security.Principal;
-
 import org.apache.jackrabbit.api.security.principal.JackrabbitPrincipal;
 
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -30,8 +28,7 @@ public class PrincipalImpl implements Ja
     private final String name;
 
     public PrincipalImpl(String name) {
-        checkNotNull(name);
-        this.name = name;
+        this.name = checkNotNull(name);
     }
 
     //----------------------------------------------------------< Principal >---
@@ -51,7 +48,7 @@ public class PrincipalImpl implements Ja
             return true;
         }
         if (obj instanceof JackrabbitPrincipal) {
-            return name.equals(((Principal) obj).getName());
+            return name.equals(((JackrabbitPrincipal) obj).getName());
         }
         return false;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java?rev=1436500&r1=1436499&r2=1436500&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableBaseProvider.java
Mon Jan 21 17:27:24 2013
@@ -39,11 +39,8 @@ abstract class AuthorizableBaseProvider 
     final IdentifierManager identifierManager;
 
     AuthorizableBaseProvider(Root root, ConfigurationParameters config) {
-        checkNotNull(root);
-        checkNotNull(config);
-
-        this.root = root;
-        this.config = config;
+        this.root = checkNotNull(root);
+        this.config = checkNotNull(config);
         this.identifierManager = new IdentifierManager(root);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalImplTest.java?rev=1436500&r1=1436499&r2=1436500&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/principal/PrincipalImplTest.java
Mon Jan 21 17:27:24 2013
@@ -42,6 +42,7 @@ public class PrincipalImplTest {
     public void testEquals() {
         List<Principal> principals = new ArrayList<Principal>();
         principals.add(new PrincipalImpl("name"));
+        principals.add(new TestPrincipal("name"));
         principals.add(new JackrabbitPrincipal() {
             @Override
             public String getName() {
@@ -69,4 +70,11 @@ public class PrincipalImplTest {
             assertFalse(principal.equals(p));
         }
     }
+
+    private class TestPrincipal extends PrincipalImpl {
+
+        public TestPrincipal(String name) {
+            super(name);
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message