jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1486870 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/ test/java/org/apache/jackrabbit/oak/security/authorization/restriction/ test/java/org/apache/jackrabbit/oak/spi/se...
Date Tue, 28 May 2013 11:21:15 GMT
Author: jukka
Date: Tue May 28 11:21:15 2013
New Revision: 1486870

URL: http://svn.apache.org/r1486870
Log:
generics

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/AbstractRestrictionProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinition.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/AbstractRestrictionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/AbstractRestrictionProvider.java?rev=1486870&r1=1486869&r2=1486870&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/AbstractRestrictionProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/AbstractRestrictionProvider.java
Tue May 28 11:21:15 2013
@@ -67,7 +67,7 @@ public abstract class AbstractRestrictio
         if (definition == null) {
             throw new AccessControlException("Unsupported restriction: " + oakName);
         }
-        Type requiredType = definition.getRequiredType();
+        Type<?> requiredType = definition.getRequiredType();
         int tag = requiredType.tag();
         if (tag != PropertyType.UNDEFINED && tag != value.getType()) {
             throw new AccessControlException("Unsupported restriction: Expected value of
type " + requiredType);
@@ -90,7 +90,7 @@ public abstract class AbstractRestrictio
         if (definition == null) {
             throw new AccessControlException("Unsupported restriction: " + oakName);
         }
-        Type requiredType = definition.getRequiredType();
+        Type<?> requiredType = definition.getRequiredType();
         for (Value v : values) {
             if (requiredType.tag() != PropertyType.UNDEFINED && requiredType.tag()
!= v.getType()) {
                 throw new AccessControlException("Unsupported restriction: Expected value
of type " + requiredType);
@@ -153,7 +153,7 @@ public abstract class AbstractRestrictio
             if (def == null) {
                 throw new AccessControlException("Unsupported restriction: " + restrName);
             }
-            Type type = entry.getValue().getType();
+            Type<?> type = entry.getValue().getType();
             if (type != def.getRequiredType()) {
                 throw new AccessControlException("Invalid restriction type '" + type + "'.
Expected " + def.getRequiredType());
             }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinition.java?rev=1486870&r1=1486869&r2=1486870&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinition.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinition.java
Tue May 28 11:21:15 2013
@@ -52,7 +52,7 @@ public interface RestrictionDefinition {
      *
      * @return The required type which must be a valid {@link javax.jcr.PropertyType}.
      */
-    Type getRequiredType();
+    Type<?> getRequiredType();
 
     /**
      * Indicates if this restriction is mandatory.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImpl.java?rev=1486870&r1=1486869&r2=1486870&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImpl.java
Tue May 28 11:21:15 2013
@@ -30,7 +30,7 @@ import static com.google.common.base.Pre
 public class RestrictionDefinitionImpl implements RestrictionDefinition {
 
     private final String name;
-    private final Type type;
+    private final Type<?> type;
     private final boolean isMandatory;
 
     /**
@@ -42,7 +42,7 @@ public class RestrictionDefinitionImpl i
      *                       is allowed.
      * @param isMandatory    A boolean indicating if the restriction is mandatory.
      */
-    public RestrictionDefinitionImpl(@Nonnull String name, Type type, boolean isMandatory)
{
+    public RestrictionDefinitionImpl(@Nonnull String name, Type<?> type, boolean isMandatory)
{
         this.name = checkNotNull(name);
         if (type.tag() == PropertyType.UNDEFINED) {
             throw new IllegalArgumentException("'undefined' is not a valid required definition
type.");
@@ -58,7 +58,7 @@ public class RestrictionDefinitionImpl i
     }
 
     @Override
-    public Type getRequiredType() {
+    public Type<?> getRequiredType() {
         return type;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImplTest.java?rev=1486870&r1=1486869&r2=1486870&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/RestrictionProviderImplTest.java
Tue May 28 11:21:15 2013
@@ -16,12 +16,12 @@
  */
 package org.apache.jackrabbit.oak.security.authorization.restriction;
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import com.google.common.collect.ImmutableList;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
@@ -36,6 +36,7 @@ import org.apache.jackrabbit.oak.util.No
 import org.junit.Before;
 import org.junit.Test;
 
+import static com.google.common.collect.Maps.newHashMap;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -79,7 +80,7 @@ public class RestrictionProviderImplTest
 
     @Test
     public void testGetRestrictionPattern() {
-        Map<PropertyState, RestrictionPattern> map = new HashMap();
+        Map<PropertyState, RestrictionPattern> map = newHashMap();
         map.put(PropertyStates.createProperty(REP_GLOB, "/*/jcr:content"), GlobPattern.create("/testPath",
"/*/jcr:content"));
         List<String> ntNames = ImmutableList.of(JcrConstants.NT_FOLDER, JcrConstants.NT_LINKEDFILE);
         map.put(PropertyStates.createProperty(REP_NT_NAMES, ntNames, Type.NAMES), new NodeTypePattern(ntNames));

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java?rev=1486870&r1=1486869&r2=1486870&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionDefinitionImplTest.java
Tue May 28 11:21:15 2013
@@ -100,7 +100,7 @@ public class RestrictionDefinitionImplTe
                 return name;
             }
             @Override
-            public Type getRequiredType() {
+            public Type<?> getRequiredType() {
                 return Type.NAME;
             }
             @Override

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java?rev=1486870&r1=1486869&r2=1486870&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/restriction/RestrictionImplTest.java
Tue May 28 11:21:15 2013
@@ -106,7 +106,7 @@ public class RestrictionImplTest extends
                 return name;
             }
             @Override
-            public Type getRequiredType() {
+            public Type<?> getRequiredType() {
                 return Type.NAME;
             }
             @Override



Mime
View raw message