[Sunxacml-commit] sunxacml/com/sun/xacml/ctx Attribute.java,1.3,1.4
Brought to you by:
farrukh_najmi,
sethp
|
From: <se...@us...> - 2003-08-29 18:52:27
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx
In directory sc8-pr-cvs1:/tmp/cvs-serv10348/com/sun/xacml/ctx
Modified Files:
Attribute.java
Log Message:
added enforcement for one and only one value on getInstance
Index: Attribute.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ctx/Attribute.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Attribute.java 25 Aug 2003 16:53:10 -0000 1.3
--- Attribute.java 29 Aug 2003 18:52:20 -0000 1.4
***************
*** 155,158 ****
--- 155,163 ----
Node node = nodes.item(i);
if (node.getNodeName().equals("AttributeValue")) {
+ // only one value can be in an Attribute
+ if (value != null)
+ throw new ParsingException("Too many values in Attribute");
+
+ // now get the value
try {
value = AttributeFactory.createAttribute(node, type);
***************
*** 162,165 ****
--- 167,174 ----
}
}
+
+ // make sure we got a value
+ if (value == null)
+ throw new ParsingException("Attribute must contain a value");
return new Attribute(id, type, issuer, issueInstant, value);
|