Commit f250aa16 authored by cdanger's avatar cdanger

- Fixed NPE with such attribute value (XACML): <AttributeValue

DataType="http://www.w3.org/2001/XMLSchema#dateTime"/>
- Added unit tests for this issue
parent b1a9e22e
......@@ -211,7 +211,7 @@ public final class ImmutableAttributeValueFactoryRegistry extends BasePdpExtensi
@Override
public AttributeValue newAttributeValue(final Serializable rawValue) throws IllegalArgumentException, UnsupportedOperationException
{
Preconditions.checkArgument(rawValue != null, "Null arg");
Preconditions.checkArgument(rawValue != null, "Null input value");
final StringParseableValueFactory<?> factory = getCompatibleFactory(rawValue.getClass());
if (factory == null)
{
......@@ -223,8 +223,9 @@ public final class ImmutableAttributeValueFactoryRegistry extends BasePdpExtensi
@Override
public AttributeBag<?> newAttributeBag(final Collection<? extends Serializable> rawVals, AttributeSource attributeValueSource) throws UnsupportedOperationException, IllegalArgumentException
{
Preconditions.checkArgument(rawVals != null && !rawVals.isEmpty(), "Null/empty arg");
Preconditions.checkArgument(rawVals != null && !rawVals.isEmpty(), "Null/empty list of input values");
final Serializable rawVal0 = rawVals.iterator().next();
Preconditions.checkArgument(rawVal0 != null, "One of the input values (#0) is null");
final StringParseableValueFactory<?> factory = getCompatibleFactory(rawVal0.getClass());
if (factory == null)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment