[Git][java-team/geronimo-jacc-1.1-spec][upstream] 2 commits: New upstream version 1.0.2

Emmanuel Bourg gitlab at salsa.debian.org
Thu Jan 21 15:20:15 GMT 2021



Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / geronimo-jacc-1.1-spec


Commits:
dc3c29eb by Emmanuel Bourg at 2021-01-21T15:53:35+01:00
New upstream version 1.0.2
- - - - -
feade5e8 by Emmanuel Bourg at 2021-01-21T15:53:45+01:00
New upstream version 1.0.3
- - - - -


24 changed files:

- LICENSE.txt → LICENSE
- NOTICE.txt → NOTICE
- pom.xml
- src/main/java/javax/security/jacc/EJBMethodPermission.java
- src/main/java/javax/security/jacc/EJBRoleRefPermission.java
- src/main/java/javax/security/jacc/HTTPMethodSpec.java
- src/main/java/javax/security/jacc/PolicyConfiguration.java
- src/main/java/javax/security/jacc/PolicyConfigurationFactory.java
- src/main/java/javax/security/jacc/PolicyContext.java
- src/main/java/javax/security/jacc/PolicyContextException.java
- src/main/java/javax/security/jacc/PolicyContextHandler.java
- src/main/java/javax/security/jacc/URLPatternSpec.java
- src/main/java/javax/security/jacc/WebResourcePermission.java
- src/main/java/javax/security/jacc/WebRoleRefPermission.java
- src/main/java/javax/security/jacc/WebUserDataPermission.java
- − src/site/site.xml
- src/test/java/javax/security/jacc/EJBMethodPermissionCollectionTest.java
- src/test/java/javax/security/jacc/EJBMethodPermissionTest.java
- src/test/java/javax/security/jacc/EJBRoleRefPermissionTest.java
- + src/test/java/javax/security/jacc/HTTPMethodSpecTest.java
- src/test/java/javax/security/jacc/MockHttpServletRequest.java
- src/test/java/javax/security/jacc/WebResourcePermissionTest.java
- src/test/java/javax/security/jacc/WebRoleRefPermissionTest.java
- src/test/java/javax/security/jacc/WebUserDataPermissionTest.java


Changes:

=====================================
LICENSE.txt → LICENSE
=====================================
@@ -200,4 +200,3 @@
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-


=====================================
NOTICE.txt → NOTICE
=====================================
@@ -1,6 +1,5 @@
 Apache Geronimo 
-Copyright 2003-2008 The Apache Software Foundation
+Copyright 2003-2009 The Apache Software Foundation
 
 This product includes software developed by
 The Apache Software Foundation (http://www.apache.org/).
-


=====================================
pom.xml
=====================================
@@ -7,9 +7,9 @@
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
-    
+
      http://www.apache.org/licenses/LICENSE-2.0
-    
+
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,41 +18,84 @@
     under the License.
 -->
 
-<!-- $Rev: 617430 $ $Date: 2008-02-01 11:32:54 +0100 (Fr, 01 Feb 2008) $ -->
+<!-- $Rev: 934071 $ $Date: 2010-04-14 20:05:10 +0200 (Wed, 14 Apr 2010) $ -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>specs</artifactId>
-        <version>1.4</version>
+        <groupId>org.apache.geronimo.genesis</groupId>
+        <artifactId>genesis-java5-flava</artifactId>
+        <version>2.0</version>
     </parent>
 
+    <groupId>org.apache.geronimo.specs</groupId>
     <artifactId>geronimo-jacc_1.1_spec</artifactId>
-    <packaging>jar</packaging>
+    <packaging>bundle</packaging>
     <name>J2EE JACC 1.1</name>
-    <version>1.0.1</version>
+    <version>1.0.3</version>
+
+    <description>Java Access Control for Containers 1.1 API</description>
+
+    <url>http://geronimo.apache.org/maven/${siteId}/${version}</url>
+    <distributionManagement>
+        <site>
+            <id>apache-website</id>
+            <url>${site.deploy.url}/maven/${siteId}/${version}</url>
+        </site>
+    </distributionManagement>
 
     <properties>
-        <geronimo.osgi.export.pkg>javax.security.jacc*</geronimo.osgi.export.pkg>
-        <geronimo.osgi.export.version>1.1</geronimo.osgi.export.version>
+        <siteId>specs/${artifactId}</siteId>
     </properties>
 
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jacc_1.1_spec-1.0.3</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jacc_1.1_spec-1.0.3</developerConnection>
+        <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/tags/geronimo-jacc_1.1_spec-1.0.3</url>
+    </scm>
+
     <dependencies>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_2.5_spec</artifactId>
-            <version>1.1.2</version>
+            <version>1.2</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-osgi-locator</artifactId>
+            <version>1.0</version>
             <scope>provided</scope>
         </dependency>
     </dependencies>
 
-    <scm>
-        <connection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jacc_1.1_spec-1.0.1</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jacc_1.1_spec-1.0.1</developerConnection>
-        <url>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jacc_1.1_spec-1.0.1</url>
-    </scm>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Specification-Title>JSR-115 Java Authorization Contract for Containers 1.1</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                        <Specification-Version>1.1</Specification-Version>
+                        <Export-Package>javax.security.jacc*;version=1.1</Export-Package>
+                        <Import-Package>javax.servlet*;resolution:=optional;version=2.5,org.apache.geronimo.osgi.registry.api;resolution:=optional,*</Import-Package>
+                        <Private-Package>org.apache.geronimo.osgi.locator</Private-Package>
+                        <Bundle-Activator>org.apache.geronimo.osgi.locator.Activator</Bundle-Activator>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>


=====================================
src/main/java/javax/security/jacc/EJBMethodPermission.java
=====================================
@@ -38,19 +38,22 @@ import java.util.LinkedList;
 import java.util.HashMap;
 import java.util.Enumeration;
 import java.util.Collections;
+import java.util.HashSet;
 
 /**
- * @version $Rev: 521639 $ $Date: 2007-03-23 10:18:38 +0100 (Fr, 23 Mär 2007) $
+ * @version $Rev: 931610 $ $Date: 2010-04-07 18:21:39 +0200 (Wed, 07 Apr 2010) $
  */
 public final class EJBMethodPermission extends Permission implements Serializable {
 
+    private static final long serialVersionUID = 1L;
+
     private final static String NEW_METHOD_INTERFACES = "org.apache.security.jacc.EJBMethodPermission.methodInterfaces";
     private static String[] methodInterfaces;
 
     static {
-        String newMethodInterfaces = (String) AccessController.doPrivileged(new
-                PrivilegedAction() {
-                    public Object run() {
+        String newMethodInterfaces = AccessController.doPrivileged(new
+                PrivilegedAction<String>() {
+                    public String run() {
                         return System.getProperty(NEW_METHOD_INTERFACES);
                     }
                 });
@@ -162,8 +165,8 @@ public final class EJBMethodPermission extends Permission implements Serializabl
                             checkMethodInterface(tokens[1]);
                             if (tokens[2].indexOf(',') > -1) {
                                 String[] test = tokens[2].split(",", -1);
-                                for (int i = 0; i < test.length; i++) {
-                                    if (test[i].length() == 0) throw new IllegalArgumentException("Invalid type name");
+                                for (String aTest : test) {
+                                    if (aTest.length() == 0) throw new IllegalArgumentException("Invalid type name");
                                 }
                             }
 
@@ -189,7 +192,7 @@ public final class EJBMethodPermission extends Permission implements Serializabl
             } else {
                 if (methodParamsArray[0] == null || methodParamsArray[0].length() == 0) throw new IllegalArgumentException("Invalid type name");
 
-                StringBuffer buffer = new StringBuffer(methodParamsArray[0]);
+                StringBuilder buffer = new StringBuilder(methodParamsArray[0]);
                 for (int i = 1; i < methodParamsArray.length; i++) {
                     if (methodParamsArray[i] == null || methodParamsArray[i].length() == 0) throw new IllegalArgumentException("Invalid type name");
 
@@ -212,10 +215,10 @@ public final class EJBMethodPermission extends Permission implements Serializabl
             if (paramTypes.length == 0) {
                 methodParams = "";
             } else {
-                StringBuffer buffer = new StringBuffer(paramTypes[0].getName());
+                StringBuilder buffer = new StringBuilder(paramTypes[0].getName());
                 for (int i = 1; i < paramTypes.length; i++) {
                     buffer.append(",");
-                    buffer.append(paramTypes[i].getName());
+                    getName(paramTypes[i], buffer);
                 }
                 methodParams = buffer.toString();
             }
@@ -223,6 +226,16 @@ public final class EJBMethodPermission extends Permission implements Serializabl
             initActions();
         }
 
+        private static void getName(Class<?> paramType, StringBuilder buffer){
+            if(paramType.isArray()){
+                getName(paramType.getComponentType(), buffer);
+                buffer.append("[]");
+            }else{
+                buffer.append(paramType.getName());
+            }
+        }
+
+
         public boolean equals(MethodSpec spec) {
             return implies(spec) && spec.implies(this);
         }
@@ -311,9 +324,12 @@ public final class EJBMethodPermission extends Permission implements Serializabl
 
     private static final class EJBMethodPermissionCollection extends PermissionCollection {
 
-        private LinkedList collection = new LinkedList();
-        private HashMap permissions = new HashMap();
-        private static final String WILDCARD = new String("$WILDCARD");
+        private static final long serialVersionUID = -3557818912959683053L;
+
+        private static final String WILDCARD = "$WILDCARD";
+        private static final HashMap<String, HashMap<String, HashSet<String>>> ALL_METHODS = new HashMap<String, HashMap<String, HashSet<String>>>();
+        private LinkedList<Permission> collection = new LinkedList<Permission>();
+        private transient HashMap<String, HashMap<String, HashMap<String, HashSet<String>>>> permissions = new HashMap<String, HashMap<String, HashMap<String, HashSet<String>>>>();
 
         /**
          * Adds a permission object to the current collection of permission objects.
@@ -330,50 +346,58 @@ public final class EJBMethodPermission extends Permission implements Serializabl
 
             if (!(permission instanceof EJBMethodPermission)) throw new IllegalArgumentException("Wrong permission type");
 
-            if (collection.contains(permission)) return;
-            else collection.add(permission);
-
             EJBMethodPermission p = (EJBMethodPermission)permission;
-            EJBMethodPermission.MethodSpec spec = p.methodSpec;
-            Object test =  permissions.get(p.getName());
+            if (collection.contains(p)) return;
+            else collection.add(p);
+
+            addEJBMethodPermission(p);
 
-            if (test instanceof Boolean) return;
+        }
+
+        private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
+            in.defaultReadObject();
+            permissions = new HashMap<String, HashMap<String, HashMap<String, HashSet<String>>>>();
+            for (Permission p: collection) {
+                addEJBMethodPermission((EJBMethodPermission)p);
+            }
+        }
+
+        private void addEJBMethodPermission(EJBMethodPermission p) {
+            MethodSpec spec = p.methodSpec;
+            HashMap<String, HashMap<String, HashSet<String>>> methods =  permissions.get(p.getName());
+
+            if (methods == ALL_METHODS) return;
 
             if (spec.methodName == null && spec.methodInterface == null && spec.methodParams == null) {
-                permissions.put(p.getName(), new Boolean(true));
+                permissions.put(p.getName(), ALL_METHODS);
                 return;
             }
 
-            HashMap methods = (HashMap)test;
             if (methods == null) {
-                methods = new HashMap();
+                methods = new HashMap<String, HashMap<String, HashSet<String>>>();
                 permissions.put(p.getName(), methods);
             }
 
-            Object methodKey = (spec.methodName == null || spec.methodName.length() == 0? WILDCARD:spec.methodName);
-            HashMap interfaces = (HashMap)methods.get(methodKey);
+            String methodKey = (spec.methodName == null || spec.methodName.length() == 0? WILDCARD:spec.methodName);
+            HashMap<String, HashSet<String>> interfaces = methods.get(methodKey);
             if (interfaces == null) {
-                interfaces = new HashMap();
+                interfaces = new HashMap<String, HashSet<String>>();
                 methods.put(methodKey, interfaces);
             }
 
-            Object interfaceKey = (spec.methodInterface == null || spec.methodInterface.length() == 0? WILDCARD:spec.methodInterface);
-            HashMap parameters = (HashMap)interfaces.get(interfaceKey);
+            String interfaceKey = (spec.methodInterface == null || spec.methodInterface.length() == 0? WILDCARD:spec.methodInterface);
+            HashSet<String> parameters = interfaces.get(interfaceKey);
             if (parameters == null) {
-                parameters = new HashMap();
+                parameters = new HashSet<String>();
                 interfaces.put(interfaceKey, parameters);
             }
 
 
-
             // an empty string for a parameter spec indicates a method w/ no parameters
-            Object parametersKey = (spec.methodParams == null? WILDCARD:spec.methodParams);
-            Object parameter = parameters.get(parametersKey);
-            if (parameter == null) {
-                parameter = new Boolean(true);
-                parameters.put(parametersKey, parameter);
+            String parametersKey = (spec.methodParams == null? WILDCARD:spec.methodParams);
+            if (!parameters.contains(parametersKey)) {
+                parameters.add(parametersKey);
             }
-
         }
 
         /**
@@ -392,19 +416,17 @@ public final class EJBMethodPermission extends Permission implements Serializabl
             EJBMethodPermission p = (EJBMethodPermission)permission;
 
             EJBMethodPermission.MethodSpec spec = p.methodSpec;
-            Object test = permissions.get(p.getName());
-
-            if (test == null) return false;
-            if (test instanceof Boolean) return true;
+            HashMap<String, HashMap<String, HashSet<String>>> methods = permissions.get(p.getName());
 
-            HashMap methods = (HashMap)test;
+            if (methods == null) return false;
+            if (methods == ALL_METHODS) return true;
 
-            Object methodKey = (spec.methodName == null || spec.methodName.length() == 0? WILDCARD:spec.methodName);
-            HashMap interfaces = (HashMap)methods.get(methodKey);
+            String methodKey = (spec.methodName == null || spec.methodName.length() == 0? WILDCARD:spec.methodName);
+            HashMap<String, HashSet<String>> interfaces = methods.get(methodKey);
 
             if (methodImplies(interfaces, spec)) return true;
             if (methodKey != WILDCARD) {
-                return methodImplies((HashMap)methods.get(WILDCARD), spec);
+                return methodImplies(methods.get(WILDCARD), spec);
             }
 
             return false;
@@ -412,16 +434,16 @@ public final class EJBMethodPermission extends Permission implements Serializabl
 
 
 
-        protected boolean methodImplies(HashMap interfaces, EJBMethodPermission.MethodSpec spec) {
+        protected boolean methodImplies(HashMap<String, HashSet<String>> interfaces, EJBMethodPermission.MethodSpec spec) {
 
             if (interfaces == null) return false;
 
-            Object interfaceKey = (spec.methodInterface == null || spec.methodInterface.length() == 0? WILDCARD:spec.methodInterface);
-            HashMap parameters = (HashMap)interfaces.get(interfaceKey);
+            String interfaceKey = (spec.methodInterface == null || spec.methodInterface.length() == 0? WILDCARD:spec.methodInterface);
+            HashSet<String> parameters = interfaces.get(interfaceKey);
 
             if (interfaceImplies(parameters, spec)) return true;
             if (interfaceKey != WILDCARD) {
-                return interfaceImplies((HashMap)interfaces.get(WILDCARD), spec);
+                return interfaceImplies(interfaces.get(WILDCARD), spec);
             }
 
             return false;
@@ -429,18 +451,17 @@ public final class EJBMethodPermission extends Permission implements Serializabl
 
 
 
-        protected boolean interfaceImplies(HashMap parameters, EJBMethodPermission.MethodSpec spec) {
+        protected boolean interfaceImplies(HashSet<String> parameters, EJBMethodPermission.MethodSpec spec) {
 
             if (parameters == null) return false;
 
             // An empty string for a parameter spec indicates a method w/ no parameters
             // so we won't convert an empty string to a wildcard.
-            Object parametersKey = (spec.methodParams == null? WILDCARD:spec.methodParams);
-            Object parameter = parameters.get(parametersKey);
+            String parametersKey = (spec.methodParams == null? WILDCARD:spec.methodParams);
 
-            if (parameter != null) return true;
+            if (parameters.contains(parametersKey)) return true;
             if (parametersKey != WILDCARD) {
-                return parameters.containsKey(WILDCARD);
+                return parameters.contains(WILDCARD);
             }
 
             return false;
@@ -453,7 +474,7 @@ public final class EJBMethodPermission extends Permission implements Serializabl
          *
          * @return an enumeration of all the Permissions.
          */
-        public Enumeration elements() {
+        public Enumeration<Permission> elements() {
             return Collections.enumeration(collection);
         }
     }


=====================================
src/main/java/javax/security/jacc/EJBRoleRefPermission.java
=====================================
@@ -40,7 +40,7 @@ import java.security.Permission;
  * which the permission applies. An EJBRoleRefPermission is checked to
  * determine if the subject is a member of the role identified by the reference.
  *
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
  */
 public final class EJBRoleRefPermission extends Permission implements Serializable {
 


=====================================
src/main/java/javax/security/jacc/HTTPMethodSpec.java
=====================================
@@ -25,15 +25,13 @@
 
 package javax.security.jacc;
 
-import java.util.List;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
+import java.util.Arrays;
 import java.util.regex.Pattern;
 
 
 /**
- * @version $Rev: 481119 $ $Date: 2006-12-01 01:37:43 +0100 (Fr, 01 Dez 2006) $
+ * @version $Rev: 792822 $ $Date: 2009-07-10 09:19:06 +0200 (Fri, 10 Jul 2009) $
  */
 final class HTTPMethodSpec {
 
@@ -92,26 +90,28 @@ final class HTTPMethodSpec {
             if (isExcluded = name.charAt(0) == '!') {
                 name = name.substring(1);
             }
-            String[] methods = name.split(",", -1);
             int tmpMask = 0;
 
-            for (int i = 0; i < methods.length; i++) {
-                boolean found = false;
+            if (name.length() > 0) {
+                String[] methods = name.split(",", -1);
+                for (int i = 0; i < methods.length; i++) {
+                    boolean found = false;
 
-                for (int j = 0; j < HTTP_METHODS.length; j++) {
-                    if (methods[i].equals(HTTP_METHODS[j])) {
-                        tmpMask |= HTTP_MASKS[j];
-                        found = true;
+                    for (int j = 0; j < HTTP_METHODS.length; j++) {
+                        if (methods[i].equals(HTTP_METHODS[j])) {
+                            tmpMask |= HTTP_MASKS[j];
+                            found = true;
 
-                        break;
+                            break;
+                        }
                     }
-                }
-                if (!found) {
-                    checkToken(methods[i]);
-                    if (extensions == null) {
-                        extensions = new ArrayList<String>(methods.length);
+                    if (!found) {
+                        checkToken(methods[i]);
+                        if (extensions == null) {
+                            extensions = new ArrayList<String>(methods.length);
+                        }
+                        add(extensions, methods[i]);
                     }
-                    add(extensions, methods[i]);
                 }
             }
             this.mask = tmpMask;
@@ -223,20 +223,25 @@ final class HTTPMethodSpec {
 
 
     public boolean equals(HTTPMethodSpec o) {
-        return mask == o.mask && transport == o.transport;
+        return mask == o.mask && transport == o.transport && isExcluded == o.isExcluded && Arrays.equals(extensionMethods, o.extensionMethods);
     }
 
     public String getActions() {
         if (actions == null) {
-            if (isAll()) {
-                actions = "";
+            StringBuilder buffer;
+            if (isAllHttpActions()) {
+                if (hasTransportGuarantee()) {
+                    buffer = new StringBuilder();
+                } else {
+                    return "";
+                }
             } else {
-                boolean first = true;
-                StringBuffer buffer = new StringBuffer();
+                buffer = new StringBuilder();
                 if (isExcluded) {
                     buffer.append("!");
                 }
 
+                boolean first = true;
                 for (int i = 0; i < HTTP_MASKS.length; i++) {
                     if ((mask & HTTP_MASKS[i]) > 0) {
                         if (first) {
@@ -247,8 +252,7 @@ final class HTTPMethodSpec {
                         buffer.append(HTTP_METHODS[i]);
                     }
                 }
-                for (int i = 0; i < extensionMethods.length; i++) {
-                    String method = extensionMethods[i];
+                for (String method : extensionMethods) {
                     if (first) {
                         first = false;
                     } else {
@@ -256,25 +260,35 @@ final class HTTPMethodSpec {
                     }
                     buffer.append(method);
                 }
+            }
 
+            if (hasTransportGuarantee()) {
                 if (transport == INTEGRAL) {
                     buffer.append(":INTEGRAL");
                 } else if (transport == CONFIDENTIAL) {
                     buffer.append(":CONFIDENTIAL");
                 }
-
-                actions = buffer.toString();
             }
+
+            actions = buffer.toString();
         }
         return actions;
     }
 
-    private boolean isAll() {
-        return isExcluded && mask == 0x00;
+    private boolean isAllHttpActions() {
+        return isExcluded && mask == 0x00 && extensionMethods.length == 0;
+    }
+
+    private boolean hasTransportGuarantee() {
+        return  !(transport == NA || transport == NONE);
     }
 
     public int hashCode() {
-        return mask ^ transport;
+        return mask ^ (transport <<8) ^ (isExcluded? 0:0x200);
+    }
+
+    public String toString() {
+        return getActions();
     }
 
     public boolean implies(HTTPMethodSpec p) {


=====================================
src/main/java/javax/security/jacc/PolicyConfiguration.java
=====================================
@@ -29,7 +29,7 @@ import java.security.Permission;
 import java.security.PermissionCollection;
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
  */
 public interface PolicyConfiguration {
 


=====================================
src/main/java/javax/security/jacc/PolicyConfigurationFactory.java
=====================================
@@ -30,6 +30,8 @@ import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.security.SecurityPermission;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 /**
  * Abstract factory and finder class for obtaining the instance of the class
  * that implements the PolicyConfigurationFactory of a provider. The factory
@@ -43,7 +45,7 @@ import java.security.SecurityPermission;
  * @see PolicyConfiguration
  * @see PolicyContextException
  *
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 924365 $ $Date: 2010-03-17 17:52:03 +0100 (Wed, 17 Mar 2010) $
  */
 public abstract class PolicyConfigurationFactory {
 
@@ -84,7 +86,7 @@ public abstract class PolicyConfigurationFactory {
                         if (factoryClassName[0] == null) throw new ClassNotFoundException("Property " + FACTORY_NAME + " not set");
                         Thread currentThread = Thread.currentThread();
                         ClassLoader tccl = currentThread.getContextClassLoader();
-                        return Class.forName(factoryClassName[0], true, tccl).newInstance();
+                        return ProviderLocator.loadClass(factoryClassName[0], PolicyConfigurationFactory.class, tccl).newInstance();
                     }
                 });
         } catch(PrivilegedActionException pae) {


=====================================
src/main/java/javax/security/jacc/PolicyContext.java
=====================================
@@ -26,18 +26,19 @@
 package javax.security.jacc;
 
 import java.security.SecurityPermission;
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 813631 $ $Date: 2009-09-11 01:19:58 +0200 (Fri, 11 Sep 2009) $
  */
 public final class PolicyContext {
 
-    private static ThreadLocal contextId = new ThreadLocal();
-    private static ThreadLocal handlerData = new ThreadLocal();
-    private static Hashtable handlers = new Hashtable();
+    private final static ThreadLocal<String> contextId = new ThreadLocal<String>();
+    private final static ThreadLocal<Object> handlerData = new ThreadLocal<Object>();
+    private static volatile Map<String, PolicyContextHandler> handlers = new HashMap<String, PolicyContextHandler>();
     private final static SecurityPermission SET_POLICY = new SecurityPermission("setPolicy");
 
     private PolicyContext() {
@@ -51,7 +52,7 @@ public final class PolicyContext {
     }
 
     public static String getContextID() {
-        return (String) contextId.get();
+        return contextId.get();
     }
 
     public static void setHandlerData(Object data) {
@@ -64,12 +65,18 @@ public final class PolicyContext {
     public static void registerHandler(String key, PolicyContextHandler handler, boolean replace) throws PolicyContextException {
         if (key == null) throw new IllegalArgumentException("Key must not be null");
         if (handler == null) throw new IllegalArgumentException("Handler must not be null");
-        if (!replace && handlers.containsKey(key)) throw new IllegalArgumentException("A handler has already been registered under '" + key + "' and replace is false.");
+        if (!handler.supports(key)) throw new IllegalArgumentException("Registered handler does not support the key '" + key + "'");
 
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) sm.checkPermission(SET_POLICY);
 
-        handlers.put(key, handler);
+        synchronized (PolicyContext.class) {
+            if (!replace && handlers.containsKey(key))
+                throw new IllegalArgumentException("A handler has already been registered under '" + key + "' and replace is false.");
+            Map<String, PolicyContextHandler> newHandlers = new HashMap<String, PolicyContextHandler>(handlers);
+            newHandlers.put(key, handler);
+            handlers = newHandlers;
+        }
     }
 
     public static Set getHandlerKeys() {
@@ -79,7 +86,7 @@ public final class PolicyContext {
     public static Object getContext(String key) throws PolicyContextException {
         if (key == null) throw new IllegalArgumentException("Key must not be null");
 
-        PolicyContextHandler handler = (PolicyContextHandler) handlers.get(key);
+        PolicyContextHandler handler = handlers.get(key);
 
         if (handler == null) throw new IllegalArgumentException("No handler can be found for the key '" + key + "'");
         if (!handler.supports(key)) throw new IllegalArgumentException("Registered handler no longer supports the key '" + key + "'");


=====================================
src/main/java/javax/security/jacc/PolicyContextException.java
=====================================
@@ -26,7 +26,7 @@
 package javax.security.jacc;
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
  */
 public class PolicyContextException extends Exception {
 


=====================================
src/main/java/javax/security/jacc/PolicyContextHandler.java
=====================================
@@ -36,7 +36,7 @@ package javax.security.jacc;
  * activated via the <code>PolicyContext</code> class must implement the
  * <code>PolicyContextHandler</code> interface.
  *
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
  */
 public interface PolicyContextHandler {
 


=====================================
src/main/java/javax/security/jacc/URLPatternSpec.java
=====================================
@@ -31,7 +31,7 @@ import java.util.LinkedList;
 import javax.servlet.http.HttpServletRequest;
 
 /**
- * @version $Rev: 498156 $ $Date: 2007-01-20 20:29:22 +0100 (Sa, 20 Jan 2007) $
+ * @version $Rev: 788107 $ $Date: 2009-06-24 20:24:35 +0200 (Wed, 24 Jun 2009) $
  */
 final class URLPatternSpec {
 
@@ -118,6 +118,10 @@ final class URLPatternSpec {
         return pattern;
     }
 
+    public String toString() {
+        return pattern;
+    }
+
     public boolean implies(URLPatternSpec p) {
 
         // The first URLPattern in the name of the argument permission is
@@ -161,7 +165,6 @@ final class URLPatternSpec {
     static String encodeColons(HttpServletRequest request) {
         String result = request.getServletPath() + (request.getPathInfo() == null ? "" : request.getPathInfo());
 
-        if (result.indexOf("%3A") > -1) result = result.replaceAll("%3A", "%3A%3A");
         if (result.indexOf(":") > -1) result = result.replaceAll(":", "%3A");
 
         return result;


=====================================
src/main/java/javax/security/jacc/WebResourcePermission.java
=====================================
@@ -36,9 +36,12 @@ import java.util.Enumeration;
 import javax.servlet.http.HttpServletRequest;
 
 /**
- * @version $Rev: 614454 $ $Date: 2008-01-23 09:45:36 +0100 (Mi, 23 Jan 2008) $
+ * @version $Rev: 931610 $ $Date: 2010-04-07 18:21:39 +0200 (Wed, 07 Apr 2010) $
  */
 public final class WebResourcePermission extends Permission implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
     private transient int cachedHashCode = 0;
     private transient URLPatternSpec urlPatternSpec;
     private transient HTTPMethodSpec httpMethodSpec;


=====================================
src/main/java/javax/security/jacc/WebRoleRefPermission.java
=====================================
@@ -29,9 +29,12 @@ import java.io.Serializable;
 import java.security.Permission;
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 931610 $ $Date: 2010-04-07 18:21:39 +0200 (Wed, 07 Apr 2010) $
  */
 public final class WebRoleRefPermission extends Permission implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
     private transient int cachedHashCode = 0;
     private String actions;
 


=====================================
src/main/java/javax/security/jacc/WebUserDataPermission.java
=====================================
@@ -43,12 +43,14 @@ import javax.servlet.http.HttpServletRequest;
  * The name of a WebUserDataPermission (also referred to as the target name)
  * identifies a Web resource by its context path relative URL pattern.
  *
- * @version $Rev: 614454 $ $Date: 2008-01-23 09:45:36 +0100 (Mi, 23 Jan 2008) $
+ * @version $Rev: 931610 $ $Date: 2010-04-07 18:21:39 +0200 (Wed, 07 Apr 2010) $
  *
  * @see java.security.Permission
  */
 public final class WebUserDataPermission extends Permission implements Serializable {
 
+    private static final long serialVersionUID = 1L;
+
     private transient int cachedHashCode = 0;
     private transient URLPatternSpec urlPatternSpec;
     private transient HTTPMethodSpec httpMethodSpec;


=====================================
src/site/site.xml deleted
=====================================
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-     http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-
-<!-- $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $ -->
-
-<project name="${project.name}">
-    
-    <body>
-        
-        ${parentProject}
-        
-        ${modules}
-        
-        ${reports}
-        
-    </body>
-
-</project>
-
-


=====================================
src/test/java/javax/security/jacc/EJBMethodPermissionCollectionTest.java
=====================================
@@ -28,10 +28,16 @@ package javax.security.jacc;
 import junit.framework.TestCase;
 
 import java.security.PermissionCollection;
+import java.security.Permission;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.util.Enumeration;
 
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 792821 $ $Date: 2009-07-10 09:17:36 +0200 (Fri, 10 Jul 2009) $
  */
 public class EJBMethodPermissionCollectionTest extends TestCase {
 
@@ -241,4 +247,23 @@ public class EJBMethodPermissionCollectionTest extends TestCase {
         assertFalse(collection.implies(new EJBMethodPermission("GoodbyeWorld", "hello,Local,")));
 
     }
+    
+    public void testSerialization() throws Exception {
+        EJBMethodPermission p = new EJBMethodPermission("HelloWorld", "");
+        PermissionCollection collection = p.newPermissionCollection();
+        collection.add(new EJBMethodPermission("HelloWorld", ""));
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream oos = new ObjectOutputStream(baos);
+        oos.writeObject(collection);
+        oos.flush();
+        byte[] bytes = baos.toByteArray();
+        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+        ObjectInputStream ois = new ObjectInputStream(bais);
+        PermissionCollection collection2 = (PermissionCollection) ois.readObject();
+        Enumeration <Permission> ps = collection2.elements();
+        Permission p2 = ps.nextElement();
+        assertEquals(p2, p);
+        assertFalse(ps.hasMoreElements());
+        assertTrue(collection2.implies(p));
+    }
 }


=====================================
src/test/java/javax/security/jacc/EJBMethodPermissionTest.java
=====================================
@@ -34,14 +34,14 @@ import java.io.ByteArrayInputStream;
 import java.io.ObjectInputStream;
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 787163 $ $Date: 2009-06-22 10:30:18 +0200 (Mon, 22 Jun 2009) $
  */
 public class EJBMethodPermissionTest extends TestCase {
     protected Method method;
 
     public void setUp() {
         try {
-            method = TestClass.class.getDeclaredMethod("cat", new Class[] { Integer.class, Float.class, Long.class, Double.class });
+            method = TestClass.class.getDeclaredMethod("cat", new Class[] { Integer.class, Float.class, Long.class, Double.class,int[].class });
         } catch (NoSuchMethodException e) {
             e.printStackTrace();  //To change body of catch statement use Options | File Templates.
         } catch (SecurityException e) {
@@ -79,35 +79,35 @@ public class EJBMethodPermissionTest extends TestCase {
         doTestSerialization(permission);
         permission = new EJBMethodPermission("foo", "cat,Home,");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", ",,a,b,c,d");
+        permission = new EJBMethodPermission("foo", ",,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat,,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", ",Home,a,b,c,d");
+        permission = new EJBMethodPermission("foo", ",Home,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat,Home,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,Home,a,b,c,d,e");
         doTestSerialization(permission);
 
 
         // methodInterface ::= "Home" | "LocalHome" | "Remote" | "Local" | "ServiceEndpoint"
-        permission = new EJBMethodPermission("foo", "cat,Home,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,Home,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat,LocalHome,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,LocalHome,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat,Remote,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,Remote,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat,Local,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,Local,a,b,c,d,e");
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat,ServiceEndpoint,a,b,c,d");
+        permission = new EJBMethodPermission("foo", "cat,ServiceEndpoint,a,b,c,d,e");
         doTestSerialization(permission);
 
         assertEquals(permission.getName(), "foo");
-        assertEquals(permission.getActions(), "cat,ServiceEndpoint,a,b,c,d");
+        assertEquals(permission.getActions(), "cat,ServiceEndpoint,a,b,c,d,e");
 
 
         // bad methodInterface
         try {
-            permission = new EJBMethodPermission("foo", "cat,Interface,a,b,c,d");
+            permission = new EJBMethodPermission("foo", "cat,Interface,a,b,c,d,e");
             fail("Bad method interface");
         } catch(IllegalArgumentException iae) {
         }
@@ -143,9 +143,9 @@ public class EJBMethodPermissionTest extends TestCase {
 
     public void testImpliesStringString() throws Exception {
         EJBMethodPermission permissionFooEEE = new EJBMethodPermission("foo", "");
-        EJBMethodPermission permissionFooMIP = new EJBMethodPermission("foo", "cat,LocalHome,a,b,c,d");
+        EJBMethodPermission permissionFooMIP = new EJBMethodPermission("foo", "cat,LocalHome,a,b,c,d,e");
         EJBMethodPermission permissionBarEEE = new EJBMethodPermission("bar", "");
-        EJBMethodPermission permissionFooEIP = new EJBMethodPermission("foo", ",LocalHome,a,b,c,d");
+        EJBMethodPermission permissionFooEIP = new EJBMethodPermission("foo", ",LocalHome,a,b,c,d,e");
         EJBMethodPermission permissionFooEIE = new EJBMethodPermission("foo", ",LocalHome,");
         EJBMethodPermission permissionFooEI  = new EJBMethodPermission("foo", ",LocalHome");
 
@@ -212,35 +212,35 @@ public class EJBMethodPermissionTest extends TestCase {
         doTestSerialization(permission);
         permission = new EJBMethodPermission("foo", "cat", "Home", new String[] {});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "", "", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "", "", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat", "", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "", "Home", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "", "Home", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat", "Home", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "Home", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
 
 
         // methodInterface ::= "Home" | "LocalHome" | "Remote" | "Local" | "ServiceEndpoint"
-        permission = new EJBMethodPermission("foo", "cat", "Home", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "Home", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat", "LocalHome", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "LocalHome", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat", "Remote", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "Remote", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat", "Local", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "Local", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
-        permission = new EJBMethodPermission("foo", "cat", "ServiceEndpoint", new String[] { "a", "b", "c", "d" });
+        permission = new EJBMethodPermission("foo", "cat", "ServiceEndpoint", new String[] { "a", "b", "c", "d", "e"});
         doTestSerialization(permission);
 
         assertEquals(permission.getName(), "foo");
-        assertEquals(permission.getActions(), "cat,ServiceEndpoint,a,b,c,d");
+        assertEquals(permission.getActions(), "cat,ServiceEndpoint,a,b,c,d,e");
 
 
         // bad methodInterface
         try {
-            permission = new EJBMethodPermission("foo", "cat", "Interface", new String[] { "a", "b", "c", "d" });
+            permission = new EJBMethodPermission("foo", "cat", "Interface", new String[] { "a", "b", "c", "d", "e"});
             fail("Bad method interface");
         } catch(IllegalArgumentException iae) {
         }
@@ -248,9 +248,9 @@ public class EJBMethodPermissionTest extends TestCase {
 
     public void testImpliesStringStringStringStringArray() throws Exception {
         EJBMethodPermission permissionFooEEE = new EJBMethodPermission("foo", "", "", null);
-        EJBMethodPermission permissionFooMIP = new EJBMethodPermission("foo", "cat", "LocalHome", new String[] { "a", "b", "c", "d" });
+        EJBMethodPermission permissionFooMIP = new EJBMethodPermission("foo", "cat", "LocalHome", new String[] { "a", "b", "c", "d", "e"});
         EJBMethodPermission permissionBarEEE = new EJBMethodPermission("bar", "", "", new String[] {});
-        EJBMethodPermission permissionFooEIP = new EJBMethodPermission("foo", "", "LocalHome", new String[] { "a", "b", "c", "d" });
+        EJBMethodPermission permissionFooEIP = new EJBMethodPermission("foo", "", "LocalHome", new String[] { "a", "b", "c", "d", "e"});
         EJBMethodPermission permissionFooEIE = new EJBMethodPermission("foo", "", "LocalHome", new String[] {});
         EJBMethodPermission permissionFooEI  = new EJBMethodPermission("foo", "", "LocalHome", null);
 
@@ -311,7 +311,7 @@ public class EJBMethodPermissionTest extends TestCase {
         doTestSerialization(permission);
 
         assertEquals(permission.getName(), "foo");
-        assertEquals(permission.getActions(), "cat,ServiceEndpoint,java.lang.Integer,java.lang.Float,java.lang.Long,java.lang.Double");
+        assertEquals(permission.getActions(), "cat,ServiceEndpoint,java.lang.Integer,java.lang.Float,java.lang.Long,java.lang.Double,int[]");
 
         // Parameter method must not be null
         try {
@@ -336,9 +336,10 @@ public class EJBMethodPermissionTest extends TestCase {
     }
 
     class TestClass {
-        public Object cat(Integer a, Float b, Long c, Double d) {
+        public Object cat(Integer a, Float b, Long c, Double d, int[] e) {
             return null;
         }
+       
     }
 }
 


=====================================
src/test/java/javax/security/jacc/EJBRoleRefPermissionTest.java
=====================================
@@ -28,7 +28,7 @@ package javax.security.jacc;
 import junit.framework.TestCase;
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
  */
 public class EJBRoleRefPermissionTest extends TestCase {
 


=====================================
src/test/java/javax/security/jacc/HTTPMethodSpecTest.java
=====================================
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.security.jacc;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Rev: 792822 $ $Date: 2009-07-10 09:19:06 +0200 (Fri, 10 Jul 2009) $
+ */
+public class HTTPMethodSpecTest extends TestCase {
+    
+    public void testHTTPMethodSpec() throws Exception {
+        testHTTPMethodSpec(true);
+        testHTTPMethodSpec(false);
+        assertEquals("NONE", new HTTPMethodSpec("NONE", true).getActions());
+    }
+
+    public void testHTTPMethodSpec(boolean parseTransport) throws Exception {
+        assertEquals("", new HTTPMethodSpec(null, parseTransport).getActions());
+        assertEquals("", new HTTPMethodSpec("", parseTransport).getActions());
+        assertEquals("", new HTTPMethodSpec("!", parseTransport).getActions());
+        assertEquals("GET", new HTTPMethodSpec("GET", parseTransport).getActions());
+        assertEquals("GET,PUT", new HTTPMethodSpec("GET,PUT", parseTransport).getActions());
+        assertEquals("GET,PUT", new HTTPMethodSpec("PUT,GET", parseTransport).getActions());
+        assertEquals("FOO", new HTTPMethodSpec("FOO", parseTransport).getActions());
+        assertEquals("!GET", new HTTPMethodSpec("!GET", parseTransport).getActions());
+        assertEquals("!FOO", new HTTPMethodSpec("!FOO", parseTransport).getActions());
+        assertEquals("!GET,PUT", new HTTPMethodSpec("!PUT,GET", parseTransport).getActions());
+        assertFalse(new HTTPMethodSpec("GET", parseTransport).equals(new HTTPMethodSpec("!GET", parseTransport)));
+    }
+}


=====================================
src/test/java/javax/security/jacc/MockHttpServletRequest.java
=====================================
@@ -33,7 +33,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
 /**
- * @version $Rev: 614454 $ $Date: 2008-01-23 09:45:36 +0100 (Mi, 23 Jan 2008) $
+ * @version $Rev: 614454 $ $Date: 2008-01-23 09:45:36 +0100 (Wed, 23 Jan 2008) $
  */
 public class MockHttpServletRequest implements HttpServletRequest {
 


=====================================
src/test/java/javax/security/jacc/WebResourcePermissionTest.java
=====================================
@@ -36,7 +36,7 @@ import javax.servlet.http.HttpServletRequest;
 import junit.framework.TestCase;
 
 /**
- * @version $Rev: 614454 $ $Date: 2008-01-23 09:45:36 +0100 (Mi, 23 Jan 2008) $
+ * @version $Rev: 704682 $ $Date: 2008-10-14 23:04:18 +0200 (Tue, 14 Oct 2008) $
  */
 public class WebResourcePermissionTest extends TestCase {
 
@@ -386,7 +386,7 @@ public class WebResourcePermissionTest extends TestCase {
         p = new WebResourcePermission(new MockHttpServletRequest("/foo", "/foo:bar", "BAR"));
         checkPermission(p, "/foo/foo%3Abar", "BAR");
         p = new WebResourcePermission(new MockHttpServletRequest("/foo", "/foo%3Abar", "BAR"));
-        checkPermission(p, "/foo/foo%3A%3Abar", "BAR");
+        checkPermission(p, "/foo/foo%3Abar", "BAR");
     }
 
     private void checkPermission(Permission p, String name, String actions) {


=====================================
src/test/java/javax/security/jacc/WebRoleRefPermissionTest.java
=====================================
@@ -28,7 +28,7 @@ package javax.security.jacc;
 import junit.framework.TestCase;
 
 /**
- * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25 Okt 2006) $
+ * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
  */
 public class WebRoleRefPermissionTest extends TestCase {
 


=====================================
src/test/java/javax/security/jacc/WebUserDataPermissionTest.java
=====================================
@@ -35,10 +35,10 @@ import java.security.Permission;
 import junit.framework.TestCase;
 
 /**
- * @version $Rev: 614454 $ $Date: 2008-01-23 09:45:36 +0100 (Mi, 23 Jan 2008) $
+ * @version $Rev: 788107 $ $Date: 2009-06-24 20:24:35 +0200 (Wed, 24 Jun 2009) $
  */
 public class WebUserDataPermissionTest extends TestCase {
-
+    
     /*
      * Testing WebResourcePermission(java.lang.String, java.lang.String)
      */
@@ -79,6 +79,7 @@ public class WebUserDataPermissionTest extends TestCase {
         testSerialization(new WebUserDataPermission("/foo", ""));
         testSerialization(new WebUserDataPermission("/foo", ":NONE"));
         testSerialization(new WebUserDataPermission("/foo", "GET,POST"));
+        testSerialization(new WebUserDataPermission("/foo", "!:CONFIDENTIAL"));
     }
 
     private void testSerialization(WebUserDataPermission permission) throws IOException, ClassNotFoundException {
@@ -129,7 +130,7 @@ public class WebUserDataPermissionTest extends TestCase {
         p = new WebUserDataPermission(new MockHttpServletRequest("/foo", "/foo:bar", "BAR"));
         checkPermission(p, "/foo/foo%3Abar", "BAR");
         p = new WebUserDataPermission(new MockHttpServletRequest("/foo", "/foo%3Abar", "BAR"));
-        checkPermission(p, "/foo/foo%3A%3Abar", "BAR");
+        checkPermission(p, "/foo/foo%3Abar", "BAR");
     }
 
     private void checkPermission(Permission p, String name, String actions) {



View it on GitLab: https://salsa.debian.org/java-team/geronimo-jacc-1.1-spec/-/compare/c0825a029ba21314aaf7efaae78d5f910f83447b...feade5e8bfc9235b8f849838dec0eebc49f2f21d

-- 
View it on GitLab: https://salsa.debian.org/java-team/geronimo-jacc-1.1-spec/-/compare/c0825a029ba21314aaf7efaae78d5f910f83447b...feade5e8bfc9235b8f849838dec0eebc49f2f21d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20210121/7db8ee73/attachment.html>


More information about the pkg-java-commits mailing list