There are two constructors of com.sun.xacml.Rule class:
1. Rule(URI id, int effect, String description, Target target, Apply condition)
Deprecated. As of 2.0 you should use the Constructor that accepts the new Condition class.
2. Rule(URI id, int effect, String description, Target target, Condition condition)
The old 1.1 version has been marked "deprecated". However, this will cause some trouble:
We should allow user to assign null for the last parameter. But it’s obvious that a null value for the last parameter will cause a compilation error - "the constructor Rule(URI, int, String, Target, Condition) is ambiguous".
It’s a common scenario that a XACML policy without conditions. Thus we cannot create a Rule object like this due to the bug:
Rule rule = new Rule(ruleID, effect, description, target, null);
Fortunately, we still have an easy workaround:
Condition condition = null;
Rule rule = new Rule(ruleID, effect, description, target, condition);
Logged In: YES
user_id=608379
Originator: NO
You can also write: new Rule(ruleID, effect, description, target, (Condition)null);