jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r986757 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/security/ main/java/org/apache/jackrabbit/core/security/authorization/acl/ main/java/org/apache/jackrabbit/core/security/principal/ main/java/org/apach...
Date Wed, 18 Aug 2010 15:57:20 GMT
Author: angela
Date: Wed Aug 18 15:57:20 2010
New Revision: 986757

URL: http://svn.apache.org/viewvc?rev=986757&view=rev
Log:
minor improvement

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AnonymousPrincipal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SystemPrincipal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/UserPrincipal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/AdminPrincipal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/EveryonePrincipal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplateTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AnonymousPrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AnonymousPrincipal.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AnonymousPrincipal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AnonymousPrincipal.java
Wed Aug 18 15:57:20 2010
@@ -32,10 +32,13 @@ public final class AnonymousPrincipal im
     public AnonymousPrincipal() {
     }
 
+    //-------------------------------------------------------------< Object >---
+    @Override
     public String toString() {
         return ("AnonymousPrincipal");
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
@@ -46,13 +49,15 @@ public final class AnonymousPrincipal im
         return false;
     }
 
+    @Override
     public int hashCode() {
         return ANONYMOUS_NAME.hashCode();
     }
 
-    //------------------------------------------------------------< Principal >
+    //----------------------------------------------------------< Principal >---
     /**
-     * {@inheritDoc}
+     * @returns Always returns "anonymous"
+     * @see Principal#getName()
      */
     public String getName() {
         return ANONYMOUS_NAME;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SystemPrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SystemPrincipal.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SystemPrincipal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SystemPrincipal.java
Wed Aug 18 15:57:20 2010
@@ -32,10 +32,13 @@ public final class SystemPrincipal imple
     public SystemPrincipal() {
     }
 
+    //-------------------------------------------------------------< Object >---
+    @Override
     public String toString() {
         return ("SystemPrincipal");
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
@@ -46,11 +49,12 @@ public final class SystemPrincipal imple
         return false;
     }
 
+    @Override
     public int hashCode() {
         return SYSTEM_USER.hashCode();
     }
 
-    //------------------------------------------------------------< Principal >
+    //----------------------------------------------------------< Principal >---
     /**
      * {@inheritDoc}
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/UserPrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/UserPrincipal.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/UserPrincipal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/UserPrincipal.java
Wed Aug 18 15:57:20 2010
@@ -39,10 +39,13 @@ public class UserPrincipal implements Pr
         this.name = name;
     }
 
+    //-------------------------------------------------------------< Object >---
+    @Override
     public String toString() {
         return ("UserPrincipal: " + name);
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
@@ -54,11 +57,12 @@ public class UserPrincipal implements Pr
         return false;
     }
 
+    @Override
     public int hashCode() {
         return name.hashCode();
     }
 
-    //------------------------------------------------------------< Principal >
+    //----------------------------------------------------------< Principal >---
     /**
      * {@inheritDoc}
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplate.java
Wed Aug 18 15:57:20 2010
@@ -196,7 +196,7 @@ class ACLTemplate extends AbstractACLTem
 
     private List<Entry> internalGetEntries(Principal principal) {
         String principalName = principal.getName();
-        List entriesPerPrincipal = new ArrayList(2);
+        List<Entry> entriesPerPrincipal = new ArrayList<Entry>(2);
         for (Entry entry : entries) {
             if (principalName.equals(entry.getPrincipal().getName())) {
                 entriesPerPrincipal.add(entry);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/AdminPrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/AdminPrincipal.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/AdminPrincipal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/AdminPrincipal.java
Wed Aug 18 15:57:20 2010
@@ -38,10 +38,12 @@ public class AdminPrincipal implements J
         return adminId;
     }
 
+    @Override
     public int hashCode() {
         return adminId.hashCode();
     }
 
+    @Override
     public boolean equals(Object obj) {
         return obj == this || obj instanceof AdminPrincipal;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/EveryonePrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/EveryonePrincipal.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/EveryonePrincipal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/EveryonePrincipal.java
Wed Aug 18 15:57:20 2010
@@ -57,10 +57,12 @@ public final class EveryonePrincipal imp
 
     //-------------------------------------------------------------< Object >---
 
+    @Override
     public int hashCode() {
         return NAME.hashCode();
     }
 
+    @Override
     public boolean equals(Object obj) {
         return obj == this || obj instanceof EveryonePrincipal;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalImpl.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalImpl.java
Wed Aug 18 15:57:20 2010
@@ -60,6 +60,7 @@ public class PrincipalImpl implements Ja
      * Two principals are equal, if their names are.
      * @see Object#equals(Object)
      */
+    @Override
     public boolean equals(Object obj) {
         if (this == obj) {
             return true;
@@ -75,6 +76,7 @@ public class PrincipalImpl implements Ja
      * @return the hash code of the principals name.
      * @see Object#hashCode()
      */
+    @Override
     public int hashCode() {
         return name.hashCode();
     }
@@ -82,6 +84,7 @@ public class PrincipalImpl implements Ja
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString() {
         return getClass().getName() + ":" + name;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java
Wed Aug 18 15:57:20 2010
@@ -261,6 +261,7 @@ public class SimpleAccessManager extends
     /**
      * @see AbstractAccessControlManager#checkInitialized()
      */
+    @Override
     protected void checkInitialized() throws IllegalStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
@@ -270,6 +271,7 @@ public class SimpleAccessManager extends
     /**
      * @see AbstractAccessControlManager#checkPermission(String,int)
      */
+    @Override
     protected void checkPermission(String absPath, int permission) throws AccessDeniedException,
PathNotFoundException, RepositoryException {
         checkValidNodePath(absPath);
         if (anonymous && permission != Permission.READ) {
@@ -280,6 +282,7 @@ public class SimpleAccessManager extends
     /**
      * @see AbstractAccessControlManager#getPrivilegeRegistry()
      */
+    @Override
     protected PrivilegeRegistry getPrivilegeRegistry()
             throws RepositoryException {
         checkInitialized();
@@ -289,6 +292,7 @@ public class SimpleAccessManager extends
     /**
      * @see AbstractAccessControlManager#checkValidNodePath(String)
      */
+    @Override
     protected void checkValidNodePath(String absPath) throws PathNotFoundException, RepositoryException
{
         Path path = resolver.getQPath(absPath);
         if (!path.isAbsolute()) {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/security/principal/PrincipalManagerTest.java
Wed Aug 18 15:57:20 2010
@@ -37,6 +37,7 @@ public class PrincipalManagerTest extend
     private PrincipalManager principalMgr;
     private Group everyone;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         if (!(superuser instanceof JackrabbitSession)) {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractACLTemplateTest.java
Wed Aug 18 15:57:20 2010
@@ -42,6 +42,7 @@ public abstract class AbstractACLTemplat
     protected Principal testPrincipal;
     protected PrincipalManager pMgr;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/AbstractEvaluationTest.java
Wed Aug 18 15:57:20 2010
@@ -55,6 +55,7 @@ public abstract class AbstractEvaluation
     private Node trn;
     private Set<String> toClear = new HashSet<String>();
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         if (!isExecutable()) {
@@ -78,6 +79,7 @@ public abstract class AbstractEvaluation
         }
     }
 
+    @Override
     protected void tearDown() throws Exception {
         for (String path : toClear) {
             try {

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/acl/ACLTemplateTest.java
Wed Aug 18 15:57:20 2010
@@ -44,10 +44,12 @@ public class ACLTemplateTest extends Abs
 
     private Map<String, Value> restrictions = Collections.<String, Value>emptyMap();
 
+    @Override
     protected String getTestPath() {
         return "/ab/c/d";
     }
 
+    @Override
     protected JackrabbitAccessControlList createEmptyTemplate(String path) throws RepositoryException
{
         SessionImpl sImpl = (SessionImpl) superuser;
         PrincipalManager princicipalMgr = sImpl.getPrincipalManager();
@@ -55,6 +57,7 @@ public class ACLTemplateTest extends Abs
         return new ACLTemplate(path, princicipalMgr, privilegeRegistry, sImpl.getValueFactory(),
sImpl);
     }
 
+    @Override
     protected Principal getSecondPrincipal() throws Exception {
         return pMgr.getEveryone();
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplateTest.java?rev=986757&r1=986756&r2=986757&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplateTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplateTest.java
Wed Aug 18 15:57:20 2010
@@ -34,15 +34,18 @@ public class ACLTemplateTest extends Abs
 
     private String testPath = "/rep:accessControl/users/test";
 
+    @Override
     protected String getTestPath() {
         return testPath;
     }
 
+    @Override
     protected JackrabbitAccessControlList createEmptyTemplate(String testPath)
             throws RepositoryException {
         return new ACLTemplate(testPrincipal, testPath, (SessionImpl) superuser, superuser.getValueFactory());
     }
 
+    @Override
     protected Principal getSecondPrincipal() throws Exception {
         return testPrincipal;
     }



Mime
View raw message