jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r785539 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security: ./ authentication/ authorization/ authorization/acl/ authorization/principalbased/ principal/ simple/ user/
Date Wed, 17 Jun 2009 10:23:03 GMT
Author: thomasm
Date: Wed Jun 17 10:23:03 2009
New Revision: 785539

URL: http://svn.apache.org/viewvc?rev=785539&view=rev
Log:
JCR-2087 Upgrade to Java 5 as the base platform

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/JackrabbitSecurityManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLEditor.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLEditor.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.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/ItemBasedPrincipal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ProviderRegistryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleLoginModule.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AMContext.java
Wed Jun 17 10:23:03 2009
@@ -18,8 +18,6 @@
 
 import org.apache.jackrabbit.core.HierarchyManager;
 import org.apache.jackrabbit.core.fs.FileSystem;
-import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
-import org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 
 import javax.jcr.Session;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
Wed Jun 17 10:23:03 2009
@@ -29,7 +29,6 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.security.AccessControlException;
-import javax.jcr.security.AccessControlManager;
 import javax.jcr.security.AccessControlPolicy;
 import javax.jcr.security.AccessControlPolicyIterator;
 import javax.jcr.security.Privilege;
@@ -128,7 +127,7 @@
      */
     public JackrabbitAccessControlPolicy[] getApplicablePolicies(Principal principal) throws
AccessDeniedException, AccessControlException, UnsupportedRepositoryOperationException, RepositoryException
{
         checkInitialized();
-        
+
         log.debug("Implementation does not provide applicable policies -> returning empty
array.");
         return new JackrabbitAccessControlPolicy[0];
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
Wed Jun 17 10:23:03 2009
@@ -40,7 +40,6 @@
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.security.AccessControlException;
-import javax.jcr.security.AccessControlManager;
 import javax.jcr.security.AccessControlPolicy;
 import javax.jcr.security.AccessControlPolicyIterator;
 import javax.jcr.security.Privilege;
@@ -97,7 +96,7 @@
 
     private NamePathResolver resolver;
 
-    private Set principals;
+    private Set<Principal> principals;
 
     private AccessControlProvider acProvider;
 
@@ -147,7 +146,11 @@
         hierMgr = amContext.getHierarchyManager();
 
         Subject subject = amContext.getSubject();
-        principals = (subject == null) ? Collections.EMPTY_SET : subject.getPrincipals();
+        if (subject == null) {
+            principals = Collections.emptySet();
+        } else {
+            principals = subject.getPrincipals();
+        }
 
         wspAccess = new WorkspaceAccess(wspAccessManager, isSystemOrAdmin(subject));
         privilegeRegistry = new PrivilegeRegistry(resolver);
@@ -454,16 +457,16 @@
 
         private final boolean isAdmin;
         // TODO: entries must be cleared if access permission to wsp changes.
-        private final List allowed;
-        private final List denied;
+        private final List <String>allowed;
+        private final List<String> denied;
 
         private WorkspaceAccess(WorkspaceAccessManager wspAccessManager,
                                 boolean isAdmin) {
             this.wspAccessManager = wspAccessManager;
             this.isAdmin = isAdmin;
             if (!isAdmin) {
-                allowed = new ArrayList(5);
-                denied = new ArrayList(5);
+                allowed = new ArrayList<String>(5);
+                denied = new ArrayList<String>(5);
             } else {
                 allowed = denied = null;
             }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/JackrabbitSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/JackrabbitSecurityManager.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/JackrabbitSecurityManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/JackrabbitSecurityManager.java
Wed Jun 17 10:23:03 2009
@@ -24,7 +24,6 @@
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.security.auth.Subject;
 
 /**
@@ -32,7 +31,7 @@
  */
 public interface JackrabbitSecurityManager {
 
-    public void init(Repository repository, Session systemSession) throws RepositoryException;
+    void init(Repository repository, Session systemSession) throws RepositoryException;
 
     /**
      * Disposes those parts of this security manager that are related to the
@@ -40,12 +39,12 @@
      *
      * @param workspaceName Name of the workspace that is being disposed.
      */
-    public void dispose(String workspaceName);
+    void dispose(String workspaceName);
 
     /**
      * Disposes this security manager instance and cleans all internal caches.
      */
-    public void close();
+    void close();
 
     /**
      * Returns a new <code>AuthContext</code> for the specified credentials and
@@ -57,7 +56,7 @@
      * and <code>subject</code>.
      * @throws RepositoryException
      */
-    public AuthContext getAuthContext(Credentials creds, Subject subject) throws RepositoryException;
+    AuthContext getAuthContext(Credentials creds, Subject subject) throws RepositoryException;
 
     /**
      * Retrieve the <code>AccessManager</code> for the given <code>session</code>.
@@ -67,7 +66,7 @@
      * @return <code>AccessManager</code> for the specified <code>session</code>.
      * @throws RepositoryException
      */
-    public AccessManager getAccessManager(Session session, AMContext amContext) throws RepositoryException;
+    AccessManager getAccessManager(Session session, AMContext amContext) throws RepositoryException;
 
     /**
      * Retrieve the principal manager for the given <code>session</code>.
@@ -78,7 +77,7 @@
      * is not supported.
      * @throws RepositoryException if an error occurs
      */
-    public PrincipalManager getPrincipalManager(Session session) throws RepositoryException;
+    PrincipalManager getPrincipalManager(Session session) throws RepositoryException;
 
     /**
      * Returns the user manager for the specified <code>session</code>.
@@ -89,7 +88,7 @@
      * not supported.
      * @throws RepositoryException
      */
-    public UserManager getUserManager(Session session) throws RepositoryException;
+    UserManager getUserManager(Session session) throws RepositoryException;
 
     /**
      * Retrieve the id to be displayed upon {@link Session#getUserID()} for
@@ -99,5 +98,5 @@
      * @return userID to be displayed upon {@link Session#getUserID()}.
      * @throws RepositoryException
      */
-    public String getUserID(Subject subject) throws RepositoryException;
+    String getUserID(Subject subject) throws RepositoryException;
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java
Wed Jun 17 10:23:03 2009
@@ -32,7 +32,6 @@
 import java.security.Principal;
 import java.security.acl.Group;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Properties;
 
 /**
@@ -53,9 +52,9 @@
     private static Logger log =
         LoggerFactory.getLogger(SimpleJBossAccessManager.class);
 
-    protected boolean system = false;
+    protected boolean system;
 
-    protected boolean anonymous = false;
+    protected boolean anonymous;
 
     //--------------------------------------------------------< AccessManager >
 
@@ -75,15 +74,13 @@
             rolefs.close();
         }
 
-        Iterator iterator = context.getSubject().getPrincipals().iterator();
-        while (iterator.hasNext()) {
-            Principal principal = (Principal) iterator.next();
+        for (Principal principal : context.getSubject().getPrincipals()) {
             if (principal instanceof Group
                     && principal.getName().equalsIgnoreCase("Roles")) {
                 Group group = (Group) principal;
-                Enumeration members = group.members();
+                Enumeration< ? extends Principal> members = group.members();
                 while (members.hasMoreElements()) {
-                    Principal member = (Principal) members.nextElement();
+                    Principal member = members.nextElement();
                     String role = rolemaps.getProperty(member.getName());
                     system = system || "full".equalsIgnoreCase(role);
                     anonymous = anonymous || "read".equalsIgnoreCase(role);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
Wed Jun 17 10:23:03 2009
@@ -18,9 +18,6 @@
 
 import org.apache.commons.collections.set.ListOrderedSet;
 import javax.jcr.GuestCredentials;
-import org.apache.jackrabbit.api.security.principal.PrincipalManager;
-import org.apache.jackrabbit.api.security.user.Impersonation;
-import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.core.config.LoginModuleConfig;
 import org.apache.jackrabbit.core.security.SecurityConstants;
 import org.apache.jackrabbit.core.security.principal.PrincipalProvider;
@@ -131,7 +128,7 @@
             }
             if (principalProvider == null) {
                 principalProvider = registry.getDefault();
-                if (principalProvider==null) {
+                if (principalProvider == null) {
                     return; // abort. not even a default principal provider
                 }
             }
@@ -267,7 +264,7 @@
             return false;
         }
 
-        // check for availablity of Credentials;
+        // check for availability of Credentials;
         Credentials creds = getCredentials();
         if (creds == null) {
             log.warn("No credentials available -> try default (anonymous) authentication.");
@@ -419,9 +416,9 @@
             throws FailedLoginException, RepositoryException {
 
         Authentication auth = getAuthentication(principal, credentials);
-        if(auth == null) {
+        if (auth == null) {
             return false;
-        } else if (auth.authenticate(credentials)){
+        } else if (auth.authenticate(credentials)) {
             return true;
         }
         throw new FailedLoginException();
@@ -453,7 +450,7 @@
      * @throws LoginException If credentials don't allow to impersonate to principal.
      * @throws RepositoryException If another error occurs.
      */
-    abstract protected boolean impersonate(Principal principal, Credentials credentials)
+    protected abstract boolean impersonate(Principal principal, Credentials credentials)
             throws RepositoryException, LoginException;
 
     /**
@@ -464,7 +461,7 @@
      * @return Authentication object for the given principal / credentials.
      * @throws RepositoryException If an error occurs.
      */
-    abstract protected Authentication getAuthentication(Principal principal, Credentials
creds)
+    protected abstract Authentication getAuthentication(Principal principal, Credentials
creds)
             throws RepositoryException;
 
     /**
@@ -543,9 +540,9 @@
         // ask subject if still no credentials
         if (null == credentials) {
             // try if subject contains SimpleCredentials
-            Set preAuthCreds = subject.getPublicCredentials(SimpleCredentials.class);
+            Set<SimpleCredentials> preAuthCreds = subject.getPublicCredentials(SimpleCredentials.class);
             if (!preAuthCreds.isEmpty()) {
-                credentials = (Credentials) preAuthCreds.iterator().next();
+                credentials = preAuthCreds.iterator().next();
             }
         }
         return credentials;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContext.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContext.java
Wed Jun 17 10:23:03 2009
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.security.authentication;
 
 import javax.security.auth.Subject;
-import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 
 /**
@@ -40,7 +39,7 @@
      * @see LoginContext#login()
      * @throws LoginException if the authentication fails.
      */
-    public abstract void login() throws LoginException;
+    void login() throws LoginException;
 
     /**
      * Return the authenticated Subject.
@@ -48,7 +47,7 @@
      * @see LoginContext#getSubject()
      * @return the authenticated Subject or <code>null</code> if authentication
failed.
      */
-    public abstract Subject getSubject();
+    Subject getSubject();
 
     /**
      * Logout the <code>Subject</code>.
@@ -56,5 +55,5 @@
      * @see LoginContext#logout()
      * @exception LoginException if the logout fails.
      */
-    public abstract void logout() throws LoginException;
+    void logout() throws LoginException;
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
Wed Jun 17 10:23:03 2009
@@ -97,7 +97,7 @@
 
         if (isJAAS()) {
             return new JAASAuthContext(appName, cbHandler, subject);
-        } else if (isLocal()){
+        } else if (isLocal()) {
             return new LocalAuthContext(config, cbHandler, subject);
         } else {
             throw new RepositoryException("No Login-Configuration");
@@ -110,7 +110,7 @@
     public boolean isJAAS() {
         if (!initialized) {
             AppConfigurationEntry[] entries = getJAASConfig();
-            isJAAS = null!=entries && entries.length>0;
+            isJAAS = null != entries && entries.length > 0;
             initialized = true;
         }
         return isJAAS;
@@ -132,9 +132,9 @@
             props = new Properties[] {config.getParameters()};
         } else {
             AppConfigurationEntry[] entries = getJAASConfig();
-            if(entries != null) {
+            if (entries != null) {
                 List tmp = new ArrayList(entries.length);
-                for(int i=0; i < entries.length; i++) {
+                for (int i = 0; i < entries.length; i++) {
                     Map opt = entries[i].getOptions();
                     if (opt != null) {
                         Properties prop = new Properties();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
Wed Jun 17 10:23:03 2009
@@ -156,8 +156,8 @@
 
     private static String getAlgorithm(String password) {
         int end = password.indexOf("}");
-        if (password.startsWith("{") && end>0) {
-            return password.substring(1,end);
+        if (password.startsWith("{") && end > 0) {
+            return password.substring(1, end);
         } else {
             return null;
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java
Wed Jun 17 10:23:03 2009
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.security.authentication;
 
 import org.apache.jackrabbit.api.security.user.Authorizable;
-import org.apache.jackrabbit.api.security.user.Impersonation;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
 import org.apache.jackrabbit.core.SessionImpl;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
Wed Jun 17 10:23:03 2009
@@ -75,7 +75,7 @@
         Map<String, String> state = new HashMap<String, String>();
         Map<String, String> options = new HashMap<String, String>();
         Properties parameters = config.getParameters();
-        Enumeration<?> names = parameters.propertyNames();
+        Enumeration< ? > names = parameters.propertyNames();
         while (names.hasMoreElements()) {
             String name = (String) names.nextElement();
             options.put(name, parameters.getProperty(name));

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactoryImpl.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProviderFactoryImpl.java
Wed Jun 17 10:23:03 2009
@@ -43,8 +43,8 @@
     /**
      * The name of the security workspace (containing users...)
      */
-    private String secWorkspaceName = null;
-    private String defaultWorkspaceName = null;
+    private String secWorkspaceName;
+    private String defaultWorkspaceName;
 
     //---------------------------------------< AccessControlProviderFactory >---
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLEditor.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLEditor.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLEditor.java
Wed Jun 17 10:23:03 2009
@@ -305,7 +305,7 @@
                 log.debug("Invalid path name for Permission: " + name + ".");
             }
         }
-        int i=0;
+        int i = 0;
         String check = name;
         while (node.hasNode(check)) {
             check = name + i;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java
Wed Jun 17 10:23:03 2009
@@ -32,7 +32,6 @@
 import org.apache.jackrabbit.core.security.authorization.AbstractCompiledPermissions;
 import org.apache.jackrabbit.core.security.authorization.AccessControlConstants;
 import org.apache.jackrabbit.core.security.authorization.AccessControlEditor;
-import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.CompiledPermissions;
 import org.apache.jackrabbit.core.security.authorization.Permission;
 import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
@@ -53,7 +52,6 @@
 import javax.jcr.Value;
 import javax.jcr.observation.Event;
 import javax.jcr.observation.EventIterator;
-import javax.jcr.observation.EventListener;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryManager;
 import java.security.Principal;
@@ -336,7 +334,7 @@
          * flag indicating that there is not 'deny READ'.
          * -> simplify {@link #grants(Path, int)} in case of permissions == READ
          */
-        private boolean readAllowed = false;
+        private boolean readAllowed;
 
         private AclPermissions(Set principals) throws RepositoryException {
             this(principals, true);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLEditor.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLEditor.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLEditor.java
Wed Jun 17 10:23:03 2009
@@ -246,7 +246,7 @@
         NodeImpl node = (NodeImpl) session.getRootNode();
         for (int i = 0; i < segms.length; i++) {
             Name nName = session.getQName(segms[i]);
-            Name ntName = (i < segms.length-1) ? NT_REP_ACCESS_CONTROL : NT_REP_PRINCIPAL_ACCESS_CONTROL;
+            Name ntName = (i < segms.length - 1) ? NT_REP_ACCESS_CONTROL : NT_REP_PRINCIPAL_ACCESS_CONTROL;
             if (node.hasNode(nName)) {
                 NodeImpl n = node.getNode(nName);
                 if (!n.isNodeType(ntName)) {
@@ -381,7 +381,7 @@
                 log.debug("Invalid path name for Permission: " + name + ".");
             }
         }
-        int i=0;
+        int i = 0;
         String check = name;
         while (node.hasNode(check)) {
             check = name + i;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java
Wed Jun 17 10:23:03 2009
@@ -18,13 +18,11 @@
 
 import org.apache.jackrabbit.core.security.authorization.AbstractAccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.AccessControlConstants;
-import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
 import org.apache.jackrabbit.core.security.authorization.AccessControlEditor;
 import org.apache.jackrabbit.core.security.authorization.CompiledPermissions;
 import org.apache.jackrabbit.core.security.authorization.Permission;
 import org.apache.jackrabbit.core.security.authorization.AbstractCompiledPermissions;
-import org.apache.jackrabbit.core.security.authorization.AccessControlUtils;
 import org.apache.jackrabbit.core.security.authorization.UnmodifiableAccessControlList;
 import org.apache.jackrabbit.core.security.SecurityConstants;
 import org.apache.jackrabbit.core.security.principal.PrincipalImpl;
@@ -50,7 +48,6 @@
 import javax.jcr.PropertyType;
 import javax.jcr.ValueFactory;
 import javax.jcr.observation.Event;
-import javax.jcr.observation.EventListener;
 import javax.jcr.observation.EventIterator;
 import java.util.Map;
 import java.util.Set;
@@ -171,7 +168,7 @@
      */
     public AccessControlPolicy[] getEffectivePolicies(Path absPath)
             throws ItemNotFoundException, RepositoryException {
-        /* 
+        /*
            TODO review
            since the per-node effect of the policies is defined by the
            rep:nodePath restriction, returning the principal-based

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLTemplate.java
Wed Jun 17 10:23:03 2009
@@ -35,7 +35,6 @@
 import javax.jcr.ValueFactory;
 import javax.jcr.security.AccessControlEntry;
 import javax.jcr.security.AccessControlException;
-import javax.jcr.security.AccessControlList;
 import javax.jcr.security.AccessControlManager;
 import javax.jcr.security.Privilege;
 import java.security.Principal;

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=785539&r1=785538&r2=785539&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 Jun 17 10:23:03 2009
@@ -27,12 +27,12 @@
     private static final String NAME = "everyone";
     private static final EveryonePrincipal INSTANCE = new EveryonePrincipal();
 
-    private EveryonePrincipal() {}
+    private EveryonePrincipal() { }
 
     public static EveryonePrincipal getInstance() {
         return INSTANCE;
     }
-    
+
     //----------------------------------------------------------< Principal >---
     public String getName() {
         return NAME;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java
Wed Jun 17 10:23:03 2009
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.security.principal;
 
 import javax.jcr.RepositoryException;
-import java.security.Principal;
 
 /**
  * <code>ItemBasedPrincipal</code> is a <code>Principal</code> that
is

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java
Wed Jun 17 10:23:03 2009
@@ -17,11 +17,9 @@
 package org.apache.jackrabbit.core.security.principal;
 
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
-import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 
 import javax.jcr.Session;
 import java.security.Principal;
-import java.security.acl.Group;
 import java.util.Properties;
 
 /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ProviderRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ProviderRegistryImpl.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ProviderRegistryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ProviderRegistryImpl.java
Wed Jun 17 10:23:03 2009
@@ -59,7 +59,7 @@
     public PrincipalProvider registerProvider(Properties config) throws RepositoryException
{
         PrincipalProvider provider = createProvider(config);
         if (provider != null) {
-            synchronized(providers) {
+            synchronized (providers) {
                 providers.put(provider.getClass().getName(), provider);
             }
         } else {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleLoginModule.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleLoginModule.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleLoginModule.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleLoginModule.java
Wed Jun 17 10:23:03 2009
@@ -18,7 +18,6 @@
 
 import org.apache.jackrabbit.core.security.authentication.AbstractLoginModule;
 import org.apache.jackrabbit.core.security.authentication.Authentication;
-import org.apache.jackrabbit.core.security.principal.PrincipalProvider;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -85,7 +84,7 @@
      * @return principal or <code>null</code> if the principal provider does
      * not contain a user-principal with the given userID/principal name.
      *
-     * @see AbstractLoginModule#getPrincipal(Credentials) 
+     * @see AbstractLoginModule#getPrincipal(Credentials)
      */
     protected Principal getPrincipal(Credentials credentials) {
         String userId = getUserID(credentials);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/GroupImpl.java
Wed Jun 17 10:23:03 2009
@@ -45,7 +45,7 @@
 
     private static final Logger log = LoggerFactory.getLogger(GroupImpl.class);
 
-    private Principal principal = null;
+    private Principal principal;
 
     private GroupImpl(NodeImpl node, UserManagerImpl userManager) throws RepositoryException
{
         super(node, userManager);
@@ -55,7 +55,7 @@
         if (node == null || !node.isNodeType(NT_REP_GROUP)) {
             throw new IllegalArgumentException();
         }
-        if(!Text.isDescendant(GROUPS_PATH, node.getPath())) {
+        if (!Text.isDescendant(GROUPS_PATH, node.getPath())) {
             throw new IllegalArgumentException("Group has to be within the Group Path");
         }
         return new GroupImpl(node, userManager);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserAccessControlProvider.java
Wed Jun 17 10:23:03 2009
@@ -27,7 +27,6 @@
 import org.apache.jackrabbit.core.security.authorization.AbstractAccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.AbstractCompiledPermissions;
 import org.apache.jackrabbit.core.security.authorization.AccessControlEditor;
-import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.CompiledPermissions;
 import org.apache.jackrabbit.core.security.authorization.NamedAccessControlPolicyImpl;
 import org.apache.jackrabbit.core.security.authorization.Permission;
@@ -109,7 +108,7 @@
     /**
      * Always returns false, since this ac provider does not use content stored
      * in items to evaluate AC information.
-     * 
+     *
      * @see org.apache.jackrabbit.core.security.authorization.AccessControlUtils#isAcItem(Path)
      */
     public boolean isAcItem(Path absPath) throws RepositoryException {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java?rev=785539&r1=785538&r2=785539&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
Wed Jun 17 10:23:03 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.security.user;
 
-import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Impersonation;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.core.NodeImpl;
@@ -39,8 +38,8 @@
 
     private final String id;
 
-    private Principal principal = null;
-    private Impersonation impersonation = null;
+    private Principal principal;
+    private Impersonation impersonation;
 
     private UserImpl(NodeImpl node, UserManagerImpl userManager) throws RepositoryException
{
         super(node, userManager);
@@ -59,14 +58,14 @@
         if (node == null || !node.isNodeType(NT_REP_USER)) {
             throw new IllegalArgumentException();
         }
-        if(!Text.isDescendant(USERS_PATH, node.getPath())) {
+        if (!Text.isDescendant(USERS_PATH, node.getPath())) {
             throw new IllegalArgumentException("User has to be within the User Path");
         }
         return new UserImpl(node, userManager);
     }
 
     /**
-     * 
+     *
      * @param password
      * @return
      * @throws RepositoryException



Mime
View raw message