Skip to content

Commit

Permalink
Extra node attributes don't throw exceptions anymore (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
thpar committed Dec 23, 2014
1 parent d179f89 commit ac73825
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ public void addNode(Node node)
}
for (Attribute nodeAttribute : nodeAttributes)
{
Object value = node.getAttribute(nodeAttribute.getName());
if (value == null)
if (!node.getAllAttributeNames().contains(nodeAttribute.getName()))
{
String errormsg = "The node " + node.ID + " does not contain the required attribute " + nodeAttribute + "!";
throw new IllegalArgumentException(errormsg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public void setAttribute(String attributeName, Object value)
}
if (name == null)
{
//FIXME: is this checking the name and not the attribute value on purpose?
//Attributes SHOULD be allowed to be null though...
String errormsg = "The attribute value should not be null!";
throw new IllegalArgumentException(errormsg);
}
Expand Down

0 comments on commit ac73825

Please sign in to comment.