Skip to main content

[identity-api-spec commits] [identity-api-spec~git:1e4f4a4e] improved (internal) implementation of testPredicate based on new Predicat

  • From: monzillo@...
  • To: commits@...
  • Subject: [identity-api-spec commits] [identity-api-spec~git:1e4f4a4e] improved (internal) implementation of testPredicate based on new Predicat
  • Date: Mon, 26 Aug 2013 19:42:15 +0000

Project:    identity-api-spec
Repository: git
Revision:   1e4f4a4e2857767a54235021196defaeedf35864
Author:     monzillo
Date:       2013-08-26 19:41:48 UTC
Link:       

Log Message:
------------
improved (internal) implementation of testPredicate based on new 
PredicateOperator sub-types, and various javadoc edits including the 
separation of the firts sentence of class description
improved (internal) implementation of testPredicate based on new 
PredicateOperator sub-types, and various javadoc edits including the 
separation of the firts sentence of class description


Revisions:
----------
634053cdc52d54e8828123866c793aad14ec3328
1e4f4a4e2857767a54235021196defaeedf35864


Modified Paths:
---------------
IdentityApiGit/src/main/java/javax/security/identity/client/AttributeSelector.java
IdentityApiGit/src/main/java/javax/security/identity/client/PropertySelector.java


Diffs:
------
--- 
a/IdentityApiGit/src/main/java/javax/security/identity/client/AttributeSelector.java
+++ 
b/IdentityApiGit/src/main/java/javax/security/identity/client/AttributeSelector.java
@@ -21,7 +21,9 @@ import 
javax.security.identity.client.expression.IDExpression;
 
 /**
  * A wrapper over an IDPedicate that makes it suitable for entity and 
attribute
- * selection. An AttributeSelector is an IDPredicate that is composed only of
+ * selection. 
+ * 
+ * An AttributeSelector is an IDPredicate that is composed only of
  * predicates formed from attribute name and attribute value Expressions.
  *
  * @author ronmonzillo
@@ -44,24 +46,28 @@ public final class AttributeSelector implements 
IDPredicate, Serializable {
                     break;
             }
             return false;
-        }
-
-        List<IDPredicate> predicates = predicate.getPredicates();
-        for (IDPredicate p : predicates) {
-            if (!testPredicate(p)) {
-                return false;
+            
+        } else if (predicate.getPredicateOperator() instanceof 
BooleanPredicateOperator) {
+            List<IDPredicate> predicates = predicate.getPredicates();
+            for (IDPredicate p : predicates) {
+                if (!testPredicate(p)) {
+                    return false;
+                }
             }
+            return true;
         }
 
-        return true;
+        return false;
     }
 
     /**
-     * Wraps an IDPredicate for use as an AttributeSelector. The constructor
-     * ensures that the argument IDPredicate was constructed from an
-     * IDExpression of ExpressionType.Value or ExpressionType.Name, or by
-     * negation, conjuction, or disjunction, from one or more IDPredicate
-     * objects that satisfy this ExpressionType criteria (recursively).
+     * Wraps an IDPredicate for use as an AttributeSelector. 
+     * 
+     * The constructor ensures that the argument IDPredicate was constructed
+     * from an IDExpression of ExpressionType.Value or ExpressionType.Name, 
or by
+     * boolean operation (e.g., negation, conjuction, or disjunction), 
+     * from one or more IDPredicate objects that satisfy this ExpressionType
+     * criteria (recursively).
      *
      * @param predicate the IDPredicate to be wrapped by the 
AttributeSelector
      *

--- 
a/IdentityApiGit/src/main/java/javax/security/identity/client/PropertySelector.java
+++ 
b/IdentityApiGit/src/main/java/javax/security/identity/client/PropertySelector.java
@@ -20,8 +20,9 @@ import java.util.List;
 import javax.security.identity.client.expression.IDExpression;
 
 /**
- * A wrapper over an IDPedicate that makes it suitable for property 
selection. A
- * PropertySelector is an IDPredicate that is composed only of predicates 
formed
+ * A wrapper over an IDPedicate that makes it suitable for property 
selection.
+ * 
+ * A PropertySelector is an IDPredicate that is composed only of predicates 
formed
  * from property name and property value Expressions.
  *
  * @author ronmonzillo
@@ -43,15 +44,17 @@ public final class PropertySelector implements 
IDPredicate, Serializable {
                     break;
             }
             return false;
-        }
-        
-        List<IDPredicate> predicates = predicate.getPredicates(); 
-        for (IDPredicate p : predicates) {
-            if (!testPredicate(p)) {
-                return false;
+            
+        } else if (predicate.getPredicateOperator() instanceof 
BooleanPredicateOperator) {
+            List<IDPredicate> predicates = predicate.getPredicates();
+            for (IDPredicate p : predicates) {
+                if (!testPredicate(p)) {
+                    return false;
+                }
             }
+            return true;
         }
-
+        
         return true;
     }
 





[identity-api-spec commits] [identity-api-spec~git:1e4f4a4e] improved (internal) implementation of testPredicate based on new Predicat

monzillo 08/26/2013
 
 
Close
loading
Please Confirm
Close