[java-identity-provider] 04/06: IDP-1121 Attribute Values are no longer generic. Stage 3

Rod Widdowson rdw at steadingsoftware.com
Fri May 17 09:10:02 EDT 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=e230d0a151909c05bbbd50f76d388f4d071907ba

commit e230d0a151909c05bbbd50f76d388f4d071907ba
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon May 13 16:32:46 2019 +0100

    IDP-1121 Attribute Values are no longer generic.  Stage 3
    
    https://issues.shibboleth.net/jira/browse/IDP-1121
    
    Except where architecturally required (which means when we
    really need the native value), do not call getValue() on an
    IdpAttributeValue.  Cast to the appropriate implementation and
    call it on that.
---
 .../idp/attribute/ByteAttributeValue.java          |  2 +-
 .../idp/attribute/EmptyAttributeValue.java         |  2 +-
 .../idp/attribute/StringAttributeValue.java        |  2 +-
 .../idp/attribute/XMLObjectAttributeValue.java     |  1 -
 .../filter/spring/basic/ScriptedTest.java          |  3 +-
 .../policy/AttributeRequesterRuleParserTest.java   |  3 +-
 .../policy/ProxiedRequesterRuleParserTest.java     |  3 +-
 .../impl/AttributeTranscoderRegistryImplTest.java  |  6 ++--
 .../ad/impl/RegexSplitAttributeDefinition.java     |  2 +-
 .../ad/impl/ScopedAttributeDefinition.java         |  2 +-
 .../ad/impl/TemplateAttributeDefinition.java       |  4 +--
 .../dc/http/impl/TemplatedBodyBuilder.java         |  4 +++
 .../resolver/dc/impl/PairwiseIdDataConnector.java  |  4 +--
 .../TemplatedExecutableSearchFilterBuilder.java    |  4 +--
 .../impl/TemplatedExecutableStatementBuilder.java  |  4 +--
 .../resolver/impl/AttributeResolverImpl.java       |  2 +-
 ...SAML1NameIdentifierAttributeDefinitionTest.java |  7 ++--
 .../impl/SAML2NameIDAttributeDefinitionTest.java   |  7 ++--
 .../resolver/ad/impl/ScopedAttributeTest.java      |  2 +-
 .../resolver/ad/impl/ScriptedAttributeTest.java    |  8 ++---
 .../resolver/ad/impl/TemplateAttributeTest.java    |  2 +-
 .../dc/http/impl/HTTPDataConnectorTest.java        | 13 ++++----
 .../dc/http/HTTPDataConnectorParserTest.java       | 31 +++++++++---------
 .../AttributeSourcedSubjectCanonicalization.java   |  7 ++--
 .../idp/authn/impl/FilterFlowsByAttribute.java     | 14 +++++---
 .../impl/IdPAttributePrincipalSerializer.java      |  3 +-
 .../DefaultAuthenticationResultSerializerTest.java |  4 +--
 .../PrepareTicketValidationResponseAction.java     | 19 ++++++++++-
 .../impl/CASStringAttributeTranscoderTest.java     |  6 ++--
 .../test/flows/c14n/actions/SetupForSAML1C14N.java |  7 ++--
 .../test/flows/c14n/actions/SetupForSAML2C14N.java |  8 ++---
 .../logic/impl/AttributeValuesHashFunction.java    | 12 +++++--
 .../profile/logic/DynamicAttributePredicate.java   |  2 +-
 .../idp/profile/logic/RegexAttributePredicate.java |  2 +-
 .../profile/logic/SimpleAttributePredicate.java    |  2 +-
 ...tributeSourcedSAML1NameIdentifierGenerator.java | 21 +++++++-----
 .../impl/AttributeSourcedSAML2NameIDGenerator.java |  9 ++---
 .../impl/PersistentSAML2NameIDGenerator.java       |  4 +--
 .../impl/SAML1ByteAttributeTranscoderTest.java     |  6 ++--
 .../impl/SAML1StringAttributeTranscoderTest.java   |  6 ++--
 .../impl/SAML2ByteAttributeTranscoderTest.java     | 38 +++++++++++-----------
 .../impl/SAML2StringAttributeTranscoderTest.java   |  8 ++---
 42 files changed, 172 insertions(+), 124 deletions(-)

diff --git a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java
index 8699277..b267b97 100644
--- a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java
+++ b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/ByteAttributeValue.java
@@ -47,7 +47,7 @@ public class ByteAttributeValue implements IdPAttributeValue {
     }
 
     /** {@inheritDoc} */
-    @Override public final byte[] getValue() {
+    public final byte[] getValue() {
         return value;
     }
 
diff --git a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java
index b92b695..4de863c 100644
--- a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java
+++ b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/EmptyAttributeValue.java
@@ -62,7 +62,7 @@ public class EmptyAttributeValue implements IdPAttributeValue {
     }
 
     /** {@inheritDoc} */
-    @Override @Nonnull public EmptyType getValue() {
+    @Nonnull public EmptyType getValue() {
         return value;
     }
 
diff --git a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/StringAttributeValue.java b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/StringAttributeValue.java
index f4bd760..44e75f7 100644
--- a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/StringAttributeValue.java
+++ b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/StringAttributeValue.java
@@ -44,7 +44,7 @@ public class StringAttributeValue implements IdPAttributeValue {
     }
 
     /** {@inheritDoc} */
-    @Override @Nonnull @NotEmpty public final String getValue() {
+    @Nonnull @NotEmpty public final String getValue() {
         return value;
     }
 
diff --git a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/XMLObjectAttributeValue.java b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/XMLObjectAttributeValue.java
index c810bdd..c790dd0 100644
--- a/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/XMLObjectAttributeValue.java
+++ b/idp-attribute-api/src/main/java/net/shibboleth/idp/attribute/XMLObjectAttributeValue.java
@@ -45,7 +45,6 @@ public class XMLObjectAttributeValue implements IdPAttributeValue {
     }
 
     /** {@inheritDoc} */
-    @Override
     public final XMLObject getValue() {
         return value;
     }
diff --git a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/ScriptedTest.java b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/ScriptedTest.java
index 2578986..f5bb7ad 100644
--- a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/ScriptedTest.java
+++ b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/ScriptedTest.java
@@ -30,6 +30,7 @@ import org.testng.annotations.Test;
 
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.filter.PolicyRequirementRule.Tristate;
 import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
 import net.shibboleth.idp.attribute.filter.matcher.impl.ScriptedMatcher;
@@ -78,7 +79,7 @@ public class ScriptedTest extends BaseAttributeFilterParserTest {
         filterContext.setPrefilteredIdPAttributes(epaUid.values());
         Set<IdPAttributeValue> x = matcher.getMatchingValues(epaUid.get("uid"), filterContext);
         assertEquals(x.size(), 1);
-        String val = (String) x.iterator().next().getValue();
+        String val = ((StringAttributeValue) x.iterator().next()).getValue();
         assertTrue(val.equals("jsmith") || val.equals("daffyDuck"));
         
     }
diff --git a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AttributeRequesterRuleParserTest.java b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AttributeRequesterRuleParserTest.java
index b322b30..2313e2c 100644
--- a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AttributeRequesterRuleParserTest.java
+++ b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/AttributeRequesterRuleParserTest.java
@@ -29,6 +29,7 @@ import org.testng.annotations.Test;
 
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.filter.Matcher;
 import net.shibboleth.idp.attribute.filter.PolicyRequirementRule;
 import net.shibboleth.idp.attribute.filter.PolicyRequirementRule.Tristate;
@@ -124,6 +125,6 @@ public class AttributeRequesterRuleParserTest extends BaseAttributeFilterParserT
         filterContext.setPrefilteredIdPAttributes(epaUid.values());
         result = matcher.getMatchingValues(epaUid.get("uid"), filterContext);
         assertEquals(result.size(), 1);
-        assertEquals(result.iterator().next().getValue(), "daffyDuck");
+        assertEquals(((StringAttributeValue) result.iterator().next()).getValue(), "daffyDuck");
     }
 }
diff --git a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/ProxiedRequesterRuleParserTest.java b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/ProxiedRequesterRuleParserTest.java
index 96eb0a6..35b1455 100644
--- a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/ProxiedRequesterRuleParserTest.java
+++ b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/policy/ProxiedRequesterRuleParserTest.java
@@ -31,6 +31,7 @@ import org.testng.annotations.Test;
 
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.filter.Matcher;
 import net.shibboleth.idp.attribute.filter.PolicyRequirementRule;
 import net.shibboleth.idp.attribute.filter.PolicyRequirementRule.Tristate;
@@ -83,7 +84,7 @@ public class ProxiedRequesterRuleParserTest extends BaseAttributeFilterParserTes
         filterContext.getSubcontext(ProxiedRequesterContext.class).getRequesters().add("https://service.example.edu/shibboleth-sp");
         result = matcher.getMatchingValues(epaUid.get("uid"), filterContext);
         assertEquals(result.size(), 1);
-        assertEquals(result.iterator().next().getValue(), "daffyDuck");
+        assertEquals(((StringAttributeValue)result.iterator().next()).getValue(), "daffyDuck");
     }
     
 }
diff --git a/idp-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java b/idp-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java
index 6bb0629..918d8af 100644
--- a/idp-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java
+++ b/idp-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java
@@ -244,7 +244,7 @@ public class AttributeTranscoderRegistryImplTest {
         assertEquals(attributes.size(), 1);
         
         assertEquals(attributes.get(0).getId(), "foo");
-        assertEquals(attributes.get(0).getValues().get(0).getValue(), "value");
+        assertEquals(((StringAttributeValue)attributes.get(0).getValues().get(0)).getValue(), "value");
     }
     
     @Test public void testDecodeTwoStringValues() throws AttributeDecodingException {
@@ -261,10 +261,10 @@ public class AttributeTranscoderRegistryImplTest {
         assertEquals(attributes.size(), 2);
         
         assertEquals(attributes.get(0).getId(), "foo");
-        assertEquals(attributes.get(0).getValues().get(0).getValue(), "value");
+        assertEquals(((StringAttributeValue)attributes.get(0).getValues().get(0)).getValue(), "value");
 
         assertEquals(attributes.get(1).getId(), "foo2");
-        assertEquals(attributes.get(1).getValues().get(0).getValue(), "value");
+        assertEquals(((StringAttributeValue)attributes.get(1).getValues().get(0)).getValue(), "value");
     }
 
     @Test public void testEncodeUnsupportedValues() throws AttributeEncodingException {
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexSplitAttributeDefinition.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexSplitAttributeDefinition.java
index 264a61a..740f266 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexSplitAttributeDefinition.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/RegexSplitAttributeDefinition.java
@@ -112,7 +112,7 @@ public class RegexSplitAttributeDefinition extends AbstractAttributeDefinition {
                         + StringAttributeValue.class.getName() + "; was given " + 
                         dependencyValue.getClass().getName()));
             } else {
-                inputValue = (String) dependencyValue.getValue();
+                inputValue = ((StringAttributeValue) dependencyValue).getValue();
             }
 
             log.debug("{} Applying regexp '{}' to input value '{}'", getLogPrefix(), regexp.pattern(), inputValue);
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeDefinition.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeDefinition.java
index b9648b8..03d8e23 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeDefinition.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeDefinition.java
@@ -109,7 +109,7 @@ public class ScopedAttributeDefinition extends AbstractAttributeDefinition {
                         + dependencyValue.getClass().getName()));
             }
 
-            valueList.add(new ScopedStringAttributeValue((String) dependencyValue.getValue(), scope));
+            valueList.add(new ScopedStringAttributeValue(((StringAttributeValue) dependencyValue).getValue(), scope));
         }
         resultantAttribute.setValues(valueList);
         return resultantAttribute;
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeDefinition.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeDefinition.java
index 57c78bc..db906b8 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeDefinition.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeDefinition.java
@@ -214,10 +214,10 @@ public class TemplateAttributeDefinition extends AbstractAttributeDefinition {
                             break;
                         default:
                             throw new ResolutionException(new UnsupportedAttributeTypeException(getLogPrefix()
-                                    + "Unknown empty attribute value type " + value.getValue()));
+                                    + "Unknown empty attribute value type " + value.getClass()));
                     }
                 } else if (value instanceof StringAttributeValue) {
-                    velocityValue = (String) value.getValue();
+                    velocityValue = ((StringAttributeValue) value).getValue();
                 } else {
                     throw new ResolutionException(new UnsupportedAttributeTypeException(getLogPrefix()
                             + "This attribute definition only supports attribute value types of "
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/TemplatedBodyBuilder.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/TemplatedBodyBuilder.java
index 5bb9b96..742774b 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/TemplatedBodyBuilder.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/TemplatedBodyBuilder.java
@@ -349,6 +349,10 @@ public class TemplatedBodyBuilder extends AbstractHTTPSearchBuilder {
             for (final Map.Entry<String, List<IdPAttributeValue>> entry : dependencyAttributes.entrySet()) {
                 final List<Object> values = new ArrayList<>(entry.getValue().size());
                 for (final IdPAttributeValue value : entry.getValue()) {
+                    if (value instanceof String) {
+                        String new_name = (String) value;
+                        
+                    }
                     values.add(value.getValue());
                 }
                 log.trace("Adding dependency {} to context with {} value(s)", entry.getKey(), values.size());
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/PairwiseIdDataConnector.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/PairwiseIdDataConnector.java
index aa1492f..27f2ea8 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/PairwiseIdDataConnector.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/impl/PairwiseIdDataConnector.java
@@ -215,12 +215,12 @@ public class PairwiseIdDataConnector extends AbstractDataConnector {
         final String val;
 
         if (attributeValue instanceof StringAttributeValue) {
-            if (StringSupport.trimOrNull((String) attributeValue.getValue()) == null) {
+            if (StringSupport.trimOrNull(((StringAttributeValue) attributeValue).getValue()) == null) {
                 log.warn("{} Source attribute {} for connector {} was all-whitespace", getLogPrefix(),
                         getSourceAttributeInformation(), getId());
                 return null;
             }
-            val = (String) attributeValue.getValue();
+            val = ((StringAttributeValue) attributeValue).getValue();
         } else if (attributeValue instanceof EmptyAttributeValue) {
             final EmptyAttributeValue emptyVal = (EmptyAttributeValue) attributeValue;
             log.warn("{} Source attribute {} value for connector {} was an empty value of type {}", getLogPrefix(),
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/TemplatedExecutableSearchFilterBuilder.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/TemplatedExecutableSearchFilterBuilder.java
index d04dcec..1401a4f 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/TemplatedExecutableSearchFilterBuilder.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/TemplatedExecutableSearchFilterBuilder.java
@@ -243,9 +243,9 @@ public class TemplatedExecutableSearchFilterBuilder extends AbstractExecutableSe
                     encodedValues.add(encode(o));
                 }
                 return encodedValues.toArray();
-            } else if (value instanceof Collection<?>) {
+            } else if (value instanceof Collection) {
                 final List<Object> encodedValues = new ArrayList();
-                for (final Object o : (Collection<?>) value) {
+                for (final Object o : (Collection) value) {
                     encodedValues.add(encode(o));
                 }
                 return encodedValues;
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/rdbms/impl/TemplatedExecutableStatementBuilder.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/rdbms/impl/TemplatedExecutableStatementBuilder.java
index 76cff38..75295bc 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/rdbms/impl/TemplatedExecutableStatementBuilder.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/rdbms/impl/TemplatedExecutableStatementBuilder.java
@@ -241,9 +241,9 @@ public class TemplatedExecutableStatementBuilder extends AbstractExecutableState
                     encodedValues.add(encode(o));
                 }
                 return encodedValues.toArray();
-            } else if (value instanceof Collection<?>) {
+            } else if (value instanceof Collection) {
                 final List<Object> encodedValues = new ArrayList<>();
-                for (final Object o : (Collection<?>) value) {
+                for (final Object o : (Collection) value) {
                     encodedValues.add(encode(o));
                 }
                 return encodedValues;
diff --git a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
index 6fdb2a8..326e97b 100644
--- a/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
+++ b/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
@@ -472,7 +472,7 @@ public class AttributeResolverImpl extends AbstractServiceableComponent<Attribut
                         log.debug("{} Stripping null value", logPrefix);
                         continue;
                     } else if (value instanceof EmptyAttributeValue) {
-                        log.debug("{} Stripping {} value", logPrefix, value.getValue());
+                        log.debug("{} Stripping {} value", logPrefix, ((EmptyAttributeValue)value).getValue());
                         continue;
                     } 
                     // ByteAttributeValue, StringAttributeValue and XMLObjectValue are Constrained to not be empty
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML1NameIdentifierAttributeDefinitionTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML1NameIdentifierAttributeDefinitionTest.java
index d86c107..cf5a2ab 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML1NameIdentifierAttributeDefinitionTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML1NameIdentifierAttributeDefinitionTest.java
@@ -38,6 +38,7 @@ import net.shibboleth.idp.attribute.EmptyAttributeValue.EmptyType;
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.StringAttributeValue;
+import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
 import net.shibboleth.idp.attribute.resolver.AttributeDefinition;
 import net.shibboleth.idp.attribute.resolver.DataConnector;
 import net.shibboleth.idp.attribute.resolver.ResolutionException;
@@ -108,7 +109,7 @@ public class SAML1NameIdentifierAttributeDefinitionTest extends OpenSAMLInitBase
         assertEquals(values.size(), 2);
         final Collection<String> nameValues = new HashSet<>(2);
         for (final IdPAttributeValue val : values) {
-            final NameIdentifier id = (NameIdentifier) val.getValue();
+            final NameIdentifier id = (NameIdentifier)((XMLObjectAttributeValue) val).getValue();
             assertEquals(id.getFormat(),  "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
             assertEquals(id.getNameQualifier(), IDP_ENTITY_ID);
             nameValues.add(id.getValue());
@@ -152,7 +153,7 @@ public class SAML1NameIdentifierAttributeDefinitionTest extends OpenSAMLInitBase
         assertEquals(outValues.size(), 2);
         final Collection<String> nameValues = new HashSet<>(2);
         for (final IdPAttributeValue val : outValues) {
-            final NameIdentifier id = (NameIdentifier) val.getValue();
+            final NameIdentifier id = (NameIdentifier)((XMLObjectAttributeValue)val).getValue();
             assertEquals(id.getFormat(),  "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
             assertEquals(id.getNameQualifier(), IDP_ENTITY_ID);
             nameValues.add(id.getValue());
@@ -247,7 +248,7 @@ public class SAML1NameIdentifierAttributeDefinitionTest extends OpenSAMLInitBase
         final Collection<IdPAttributeValue> values = context.getResolvedIdPAttributes().get(TEST_ATTRIBUTE_NAME).getValues();
 
         assertEquals(values.size(), 1);
-        final NameIdentifier id = (NameIdentifier) values.iterator().next().getValue();
+        final NameIdentifier id = (NameIdentifier)((XMLObjectAttributeValue) values.iterator().next()).getValue();
         assertEquals(id.getFormat(), ALTERNATIVE_FORMAT);
         assertEquals(defn.getNameIdFormat(), id.getFormat());
         assertEquals(id.getNameQualifier(), ALTERNATE_QUALIFIER);
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML2NameIDAttributeDefinitionTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML2NameIDAttributeDefinitionTest.java
index de2145c..0ef1fc8 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML2NameIDAttributeDefinitionTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/SAML2NameIDAttributeDefinitionTest.java
@@ -38,6 +38,7 @@ import net.shibboleth.idp.attribute.EmptyAttributeValue.EmptyType;
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.StringAttributeValue;
+import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
 import net.shibboleth.idp.attribute.resolver.AttributeDefinition;
 import net.shibboleth.idp.attribute.resolver.AttributeResolver;
 import net.shibboleth.idp.attribute.resolver.DataConnector;
@@ -125,7 +126,7 @@ public class SAML2NameIDAttributeDefinitionTest extends OpenSAMLInitBaseTestCase
         assertEquals(values.size(), 2);
         final Collection<String> nameValues = new HashSet<>(2);
         for (final IdPAttributeValue val : values) {
-            final NameID id = (NameID) val.getValue();
+            final NameID id = (NameID) ((XMLObjectAttributeValue)val).getValue();
             assertEquals(id.getFormat(), "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
             assertNull(id.getSPProvidedID());
             assertEquals(id.getSPNameQualifier(), TestSources.SP_ENTITY_ID);
@@ -172,7 +173,7 @@ public class SAML2NameIDAttributeDefinitionTest extends OpenSAMLInitBaseTestCase
         assertEquals(outValues.size(), 2);
         final Collection<String> nameValues = new HashSet<>(2);
         for (final IdPAttributeValue val : outValues) {
-            final NameID id = (NameID) val.getValue();
+            final NameID id = (NameID)((XMLObjectAttributeValue)val).getValue();
             assertEquals(id.getFormat(),  "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
             assertEquals(id.getNameQualifier(), TestSources.IDP_ENTITY_ID);
             nameValues.add(id.getValue());
@@ -269,7 +270,7 @@ public class SAML2NameIDAttributeDefinitionTest extends OpenSAMLInitBaseTestCase
         final Collection<IdPAttributeValue> values = context.getResolvedIdPAttributes().get(TEST_ATTRIBUTE_NAME).getValues();
 
         assertEquals(values.size(), 1);
-        final NameID id = (NameID) values.iterator().next().getValue();
+        final NameID id = (NameID) ((XMLObjectAttributeValue)values.iterator().next()).getValue();
         assertEquals(id.getFormat(), ALTERNATIVE_FORMAT);
         assertEquals(defn.getNameIdFormat(), id.getFormat());
         assertNull(id.getSPProvidedID());
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java
index 517714f..cec6f34 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScopedAttributeTest.java
@@ -98,7 +98,7 @@ public class ScopedAttributeTest {
         resolver.resolveAttributes(context);
 
         // Now test that we got exactly what we expected - two scoped attributes
-        final Collection<?> f = context.getResolvedIdPAttributes().get(TEST_ATTRIBUTE_NAME).getValues();
+        final Collection f = context.getResolvedIdPAttributes().get(TEST_ATTRIBUTE_NAME).getValues();
 
         assertEquals(f.size(), 2);
         assertTrue(
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java
index 84f682c..7f97b1c 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/ScriptedAttributeTest.java
@@ -128,7 +128,7 @@ public class ScriptedAttributeTest extends XMLObjectBaseTestCase {
 
         assertTrue(test.equals(val), "Scripted result is the same as bases");
         assertEquals(results.size(), 1, "Scripted result value count");
-        assertEquals(results.iterator().next().getValue(), SIMPLE_VALUE, "Scripted result contains known value");
+        assertEquals(((StringAttributeValue)results.iterator().next()).getValue(), SIMPLE_VALUE, "Scripted result contains known value");
     }
     
     /**
@@ -188,7 +188,7 @@ public class ScriptedAttributeTest extends XMLObjectBaseTestCase {
 
         assertTrue(test.equals(val), "Scripted result is the same as bases");
         assertEquals(results.size(), 1, "Scripted result value count");
-        assertEquals(results.get(0).getValue(), SIMPLE_VALUE, "Scripted result contains known value");
+        assertEquals(((StringAttributeValue)results.get(0)).getValue(), SIMPLE_VALUE, "Scripted result contains known value");
     }
 
     /**
@@ -218,7 +218,7 @@ public class ScriptedAttributeTest extends XMLObjectBaseTestCase {
 
         assertTrue(test.equals(val), "Scripted result is the same as bases");
         assertEquals(results.size(), 1, "Scripted result value count");
-        assertEquals(results.iterator().next().getValue(), SIMPLE_VALUE, "Scripted result contains known value");
+        assertEquals(((StringAttributeValue)results.iterator().next()).getValue(), SIMPLE_VALUE, "Scripted result contains known value");
     }
 
     @Test public void nullValue() throws ResolutionException, ComponentInitializationException, ScriptException,
@@ -550,7 +550,7 @@ public class ScriptedAttributeTest extends XMLObjectBaseTestCase {
 
         IdPAttribute attribute = runExample("example1.script", "example1.attribute.xml", "swissEduPersonUniqueID");
 
-        assertEquals(attribute.getValues().iterator().next().getValue(),
+        assertEquals(((StringAttributeValue)attribute.getValues().iterator().next()).getValue(),
                 DigestUtils.md5Hex("12345678some#salt#value#12345679") + "@switch.ch");
 
         attribute = runExample("example2.script", "example2.attribute.xml", "eduPersonAffiliation");
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java
index 2616fae..e4309ad 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java
@@ -153,7 +153,7 @@ public class TemplateAttributeTest {
         final AttributeResolutionContext context = new AttributeResolutionContext();
         context.getSubcontext(AttributeResolverWorkContext.class, true);
         final IdPAttribute val = attr.resolve(context);
-        final Collection<?> results = val.getValues();
+        final Collection results = val.getValues();
 
         assertEquals(results.size(), 0, "Templated value count");
 
diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/HTTPDataConnectorTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/HTTPDataConnectorTest.java
index d10b3a6..cf83ac5 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/HTTPDataConnectorTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/http/impl/HTTPDataConnectorTest.java
@@ -36,6 +36,7 @@ import org.testng.annotations.Test;
 
 import net.shibboleth.ext.spring.resource.ResourceHelper;
 import net.shibboleth.idp.attribute.IdPAttribute;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.resolver.ResolutionException;
 import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
 import net.shibboleth.idp.attribute.resolver.dc.impl.TestCache;
@@ -101,11 +102,11 @@ public class HTTPDataConnectorTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue) attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
     }
 
     @Test(expectedExceptions=ResolutionException.class) public void testBadProtocol()
@@ -275,11 +276,11 @@ public class HTTPDataConnectorTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue)attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
     }
 
     @Test(enabled=false) public void testCacheable() throws ComponentInitializationException, ResolutionException, ScriptException, IOException {
diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java
index 40f5570..c1d9fea 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/http/HTTPDataConnectorParserTest.java
@@ -40,6 +40,7 @@ import com.google.common.collect.Collections2;
 import net.shibboleth.ext.spring.resource.PreferFileSystemResourceLoader;
 import net.shibboleth.ext.spring.util.ApplicationContextBuilder;
 import net.shibboleth.idp.attribute.IdPAttribute;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.resolver.ResolutionException;
 import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
 import net.shibboleth.idp.attribute.resolver.dc.http.impl.HTTPDataConnector;
@@ -95,11 +96,11 @@ public class HTTPDataConnectorParserTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue)attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
         
         assertTrue(connector.getResultsCache().size() == 1);
     }
@@ -205,11 +206,11 @@ public class HTTPDataConnectorParserTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue)attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
     }
 
     @Test(expectedExceptions=ResolutionException.class) public void v2BadCertificate() throws Exception {
@@ -276,11 +277,11 @@ public class HTTPDataConnectorParserTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue)attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
     }
     
     @Test public void hybridConfig() throws Exception {
@@ -304,11 +305,11 @@ public class HTTPDataConnectorParserTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue)attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
         
         assertTrue(connector.getResultsCache().size() == 1);    
     }
@@ -335,11 +336,11 @@ public class HTTPDataConnectorParserTest {
         assertEquals(attrs.size(), 2);
         
         assertEquals(attrs.get("foo").getValues().size(), 1);
-        assertEquals(attrs.get("foo").getValues().get(0).getValue(), "foo1");
+        assertEquals(((StringAttributeValue)attrs.get("foo").getValues().get(0)).getValue(), "foo1");
         
         assertEquals(attrs.get("bar").getValues().size(), 2);
-        assertEquals(attrs.get("bar").getValues().get(0).getValue(), "bar1");
-        assertEquals(attrs.get("bar").getValues().get(1).getValue(), "bar2");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(0)).getValue(), "bar1");
+        assertEquals(((StringAttributeValue)attrs.get("bar").getValues().get(1)).getValue(), "bar2");
     }
     
     private HTTPDataConnector getDataConnector(final PropertySource propSource, final String... beanDefinitions)
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java
index c923e2b..ff2727d 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java
@@ -163,13 +163,14 @@ public class AttributeSourcedSubjectCanonicalization extends AbstractSubjectCano
             }
             for (final IdPAttributeValue val : attr.getValues()) {
                 if (val instanceof StringAttributeValue) {
-                    if (val.getValue() == null || ((StringAttributeValue) val).getValue().isEmpty()) {
+                    final StringAttributeValue stringVal = (StringAttributeValue) val;
+                    if (stringVal.getValue() == null || stringVal.getValue().isEmpty()) {
                         log.debug("{} Ignoring null/empty string value", getLogPrefix());
                         continue;
                     }
                     log.debug("{} Using attribute {} string value {} as input to transforms", getLogPrefix(), id,
-                            val.getValue());
-                    c14nContext.setPrincipalName(applyTransforms(((StringAttributeValue) val).getValue()));
+                            stringVal.getValue());
+                    c14nContext.setPrincipalName(applyTransforms(stringVal.getValue()));
                     return;
                 } else if (val instanceof ScopedStringAttributeValue) {
                     final ScopedStringAttributeValue scoped = (ScopedStringAttributeValue) val;
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java
index 0d54a4e..5d1f683 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/FilterFlowsByAttribute.java
@@ -216,8 +216,11 @@ public class FilterFlowsByAttribute extends AbstractAuthenticationAction {
             log.debug("{} Comparing principal {} against attribute values {}", getLogPrefix(), p.getName(),
                     attribute.getValues());
             for (final IdPAttributeValue val : attribute.getValues()) {
-                if (val instanceof StringAttributeValue && Objects.equals(val.getValue(), p.getName())) {
-                    return p.getName();
+                if (val instanceof StringAttributeValue) {
+                    final StringAttributeValue stringVal = (StringAttributeValue) val;
+                    if (Objects.equals(stringVal.getValue(), p.getName())) {
+                        return p.getName();
+                    }
                 }
             }
         }
@@ -240,8 +243,11 @@ public class FilterFlowsByAttribute extends AbstractAuthenticationAction {
             log.debug("{} Comparing principal {} against attribute values {}", getLogPrefix(), p.getName(),
                     attribute.getValues());
             for (final IdPAttributeValue val : attribute.getValues()) {
-                if (val instanceof StringAttributeValue && Objects.equals(val.getValue(), p.getName())) {
-                    return p.getName();
+                if (val instanceof StringAttributeValue) {
+                    final StringAttributeValue stringVal = (StringAttributeValue) val;
+                    if (val instanceof StringAttributeValue && Objects.equals(stringVal.getValue(), p.getName())) {
+                        return p.getName();
+                    }
                 }
             }
         }
diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/principal/impl/IdPAttributePrincipalSerializer.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/principal/impl/IdPAttributePrincipalSerializer.java
index 20426d9..0d6d738 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/principal/impl/IdPAttributePrincipalSerializer.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/principal/impl/IdPAttributePrincipalSerializer.java
@@ -182,7 +182,8 @@ public class IdPAttributePrincipalSerializer extends AbstractPrincipalSerializer
         final JsonObjectBuilder builder = getJsonObjectBuilder();
         
         if (value instanceof EmptyAttributeValue) {
-            if (value.getValue().equals(EmptyType.NULL_VALUE)) {
+            final EmptyAttributeValue eVal = (EmptyAttributeValue) value;
+            if (eVal.getValue().equals(EmptyType.NULL_VALUE)) {
                 // Null
                 builder.add(EMPTY_VALUE_FIELD, 0);
             } else {
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializerTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializerTest.java
index 13b9b91..a02a892 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializerTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/DefaultAuthenticationResultSerializerTest.java
@@ -263,8 +263,8 @@ public class DefaultAuthenticationResultSerializerTest {
         final IdPAttribute attribute =
                 ((IdPAttributePrincipal) result2.getSubject().getPrincipals().iterator().next()).getAttribute();
         Assert.assertEquals(attribute.getValues().size(), 3);
-        Assert.assertEquals(attribute.getValues().get(0).getValue(), "bar");
-        Assert.assertEquals(attribute.getValues().get(1).getValue(), "bar2");
+        Assert.assertEquals(((StringAttributeValue) attribute.getValues().get(0)).getValue(), "bar");
+        Assert.assertEquals(((StringAttributeValue)attribute.getValues().get(1)).getValue(), "bar2");
         Assert.assertEquals(((ScopedStringAttributeValue) attribute.getValues().get(1)).getScope(), "scope");
         Assert.assertEquals(attribute.getValues().get(2), EmptyAttributeValue.ZERO_LENGTH);
     }
diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java
index a82acf2..337bd4f 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/PrepareTicketValidationResponseAction.java
@@ -26,6 +26,9 @@ import javax.annotation.Nonnull;
 
 import net.shibboleth.idp.attribute.AttributeEncodingException;
 import net.shibboleth.idp.attribute.IdPAttribute;
+import net.shibboleth.idp.attribute.IdPAttributeValue;
+import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.context.AttributeContext;
 import net.shibboleth.idp.attribute.transcoding.AttributeTranscoder;
 import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
@@ -125,6 +128,7 @@ public class PrepareTicketValidationResponseAction extends
     }
     
     /** {@inheritDoc} */
+ // CheckStyle: CyclomaticComplexity OFF
     @Override
     protected void doExecute(final @Nonnull ProfileRequestContext profileRequestContext) {
 
@@ -144,7 +148,19 @@ public class PrepareTicketValidationResponseAction extends
             log.debug("Using {} for CAS username", userAttributeName);
             final IdPAttribute attribute = ac.getIdPAttributes().get(userAttributeName);
             if (attribute != null && !attribute.getValues().isEmpty()) {
-                principal = attribute.getValues().get(0).getValue().toString();
+                final IdPAttributeValue value = attribute.getValues().get(0);
+                if (value instanceof ScopedStringAttributeValue) {
+                    final ScopedStringAttributeValue scopedValue = (ScopedStringAttributeValue) value;
+                    log.warn("Lossy use of attribute value {} from attribute {}",
+                            scopedValue.getValue(), attribute.getId());
+                    principal = scopedValue.getValue();
+                } else if (value instanceof StringAttributeValue) {
+                    principal = ((StringAttributeValue) value).getValue();
+                } else {
+                    log.warn("Use of attribute value type {} from attribute {}",
+                            value.getClass(), attribute.getId());
+                    principal = value.getValue().toString();
+                }
             } else {
                 log.debug("Filtered attribute {} has no value", userAttributeName);
                 principal = null;
@@ -182,6 +198,7 @@ public class PrepareTicketValidationResponseAction extends
         
         encodedAttributes.forEach(a -> response.addAttribute(a));
     }
+    // CheckStyle: CyclomaticComplexity ON
 
     /**
      * Access the registry of transcoding rules to transform the input attribute into a target type.
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
index 14dc10f..63a1829 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/attribute/transcoding/impl/CASStringAttributeTranscoderTest.java
@@ -172,7 +172,7 @@ public class CASStringAttributeTranscoderTest {
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_ID);
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
     }
         
     @Test public void multi() throws Exception {
@@ -218,8 +218,8 @@ public class CASStringAttributeTranscoderTest {
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_ID);
         Assert.assertEquals(attr.getValues().size(), 2);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
-        Assert.assertEquals(attr.getValues().get(1).getValue().toString(), STRING_2);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(1)).getValue().toString(), STRING_2);
     }
 
 }
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java
index 8ce44d1..3ebe8a1 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML1C14N.java
@@ -33,6 +33,7 @@ import org.opensaml.saml.saml1.core.NameIdentifier;
 
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.context.AttributeContext;
 import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
 import net.shibboleth.idp.profile.AbstractProfileAction;
@@ -71,11 +72,11 @@ public class SetupForSAML1C14N extends AbstractProfileAction {
         final NameIdentifier nameId = identifierBuilder.buildObject();
         nameId.setFormat(NameIdentifier.UNSPECIFIED);
         for (final IdPAttributeValue attrValue : attributeValues) {
-            if (attrValue == null || attrValue.getValue() == null) {
+            if (attrValue == null) {
                 continue;
             }
-            final Object value = attrValue.getValue();
-            if (value instanceof String) {
+            if (attrValue instanceof StringAttributeValue) {
+                final String value = ((StringAttributeValue)attrValue).getValue();
                 // Check for empty or all-whitespace, but don't trim.
                 if (StringSupport.trimOrNull((String) value) == null) {
                     continue;
diff --git a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java
index 20a7c47..d55101f 100644
--- a/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java
+++ b/idp-conf/src/test/java/net/shibboleth/idp/test/flows/c14n/actions/SetupForSAML2C14N.java
@@ -34,6 +34,7 @@ import org.opensaml.saml.saml2.core.NameIDType;
 
 import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.IdPAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.context.AttributeContext;
 import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
 import net.shibboleth.idp.profile.AbstractProfileAction;
@@ -70,12 +71,11 @@ public class SetupForSAML2C14N extends AbstractProfileAction {
         final NameID nameId = identifierBuilder.buildObject();
         nameId.setFormat(NameIDType.UNSPECIFIED);
         for (final IdPAttributeValue attrValue : attributeValues) {
-            if (attrValue == null || attrValue.getValue() == null) {
+            if (attrValue == null) {
                 continue;
             }
-            
-            final Object value = attrValue.getValue();
-            if (value instanceof String) {
+            if (attrValue instanceof StringAttributeValue) {
+                final String value = ((StringAttributeValue)attrValue).getValue();
                 // Check for empty or all-whitespace, but don't trim.
                 if (StringSupport.trimOrNull((String) value) == null) {
                     continue;
diff --git a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java
index 2501abb..6e75299 100644
--- a/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java
+++ b/idp-consent-impl/src/main/java/net/shibboleth/idp/consent/logic/impl/AttributeValuesHashFunction.java
@@ -28,12 +28,14 @@ import javax.annotation.Nullable;
 
 import net.shibboleth.idp.attribute.IdPAttributeValue;
 import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
+import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
 import net.shibboleth.utilities.java.support.annotation.constraint.NullableElements;
 import net.shibboleth.utilities.java.support.xml.SerializeSupport;
 
 import org.cryptacular.util.CodecUtil;
 import org.cryptacular.util.HashUtil;
+import org.opensaml.core.xml.XMLObject;
 import org.opensaml.core.xml.io.MarshallingException;
 import org.opensaml.core.xml.util.XMLObjectSupport;
 import org.opensaml.saml.saml2.core.NameIDType;
@@ -78,17 +80,21 @@ public class AttributeValuesHashFunction implements Function<Collection<IdPAttri
                     objectOutputStream.writeObject(((ScopedStringAttributeValue) value).getValue() + '@'
                             + ((ScopedStringAttributeValue) value).getScope());
                 } else if (value instanceof XMLObjectAttributeValue) {
-                    if (value.getValue() instanceof NameIDType) {
-                        objectOutputStream.writeObject(((NameIDType) value.getValue()).getValue());
+                    final XMLObject xmlObject = ((XMLObjectAttributeValue) value).getValue();
+                    if (xmlObject instanceof NameIDType) {
+                        objectOutputStream.writeObject(((NameIDType) xmlObject).getValue());
                     } else {
                         try {
                             objectOutputStream.writeObject(SerializeSupport.nodeToString(
-                                    XMLObjectSupport.marshall(((XMLObjectAttributeValue) value).getValue())));
+                                    XMLObjectSupport.marshall(xmlObject)));
                         } catch (final MarshallingException e) {
                             log.error("Error while marshalling XMLObject value", e);
                             return null;
                         }
                     }
+                } else if (value instanceof StringAttributeValue) {
+                    objectOutputStream.writeObject(((StringAttributeValue)value).getValue());
+                
                 } else if (value.getValue() != null) {
                     objectOutputStream.writeObject(value.getValue());
                 }
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicate.java
index a999f90..f58cd06 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/DynamicAttributePredicate.java
@@ -158,7 +158,7 @@ public class DynamicAttributePredicate extends AbstractAttributePredicate {
         } else {
             for (final IdPAttributeValue value : attribute.getValues()) {
                 if (value instanceof StringAttributeValue) {
-                    if (toMatch.equals(value.getValue())) {
+                    if (toMatch.equals(((StringAttributeValue)value).getValue())) {
                         log.debug("Found matching value ({}) in attribute {}", toMatch, attribute.getId());
                         return true;
                     }
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RegexAttributePredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RegexAttributePredicate.java
index d47d8d3..b81b82c 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RegexAttributePredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/RegexAttributePredicate.java
@@ -113,7 +113,7 @@ public class RegexAttributePredicate extends AbstractAttributePredicate {
         
         for (final IdPAttributeValue value : attribute.getValues()) {
             if (value instanceof StringAttributeValue) {
-                final Matcher m = pattern.matcher((String) value.getValue());
+                final Matcher m = pattern.matcher((String) ((StringAttributeValue)value).getValue());
                 if (m.matches()) {
                     log.debug("Found matching value '{}' in attribute '{}'", m.group(), attributeId);
                     return true;
diff --git a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java
index f725ea4..56fc488 100644
--- a/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java
+++ b/idp-profile-api/src/main/java/net/shibboleth/idp/profile/logic/SimpleAttributePredicate.java
@@ -128,7 +128,7 @@ public class SimpleAttributePredicate extends AbstractAttributePredicate {
         } else {
             for (final IdPAttributeValue value : attribute.getValues()) {
                 if (value instanceof StringAttributeValue) {
-                    if (toMatch.equals(value.getValue())) {
+                    if (toMatch.equals(((StringAttributeValue)value).getValue())) {
                         log.debug("Found matching value ({}) in attribute {}", toMatch, attribute.getId());
                         return true;
                     }
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java
index 3ccfb7c..fd71630 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGenerator.java
@@ -43,6 +43,7 @@ import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
+import org.opensaml.core.xml.XMLObject;
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.opensaml.saml.common.SAMLException;
@@ -166,13 +167,17 @@ public class AttributeSourcedSAML1NameIdentifierGenerator extends AbstractSAML1N
 
             final List<IdPAttributeValue> values = attribute.getValues();
             for (final IdPAttributeValue value : values) {
-                if (value instanceof XMLObjectAttributeValue && value.getValue() instanceof NameIdentifier) {
-                    if (SAML1ObjectSupport.areNameIdentifierFormatsEquivalent(getFormat(),
-                            ((NameIdentifier) value.getValue()).getFormat())) {
-                        log.info("Returning NameIdentifier from XMLObject-valued attribute {}", sourceId);
-                        return (NameIdentifier) value.getValue();
-                    } else {
-                        log.debug("Attribute {} value was NameIdentifier, but Format did not match", sourceId);
+                if (value instanceof XMLObjectAttributeValue) {
+                    final XMLObject xmlObject = ((XMLObjectAttributeValue)value).getValue();
+                    if (xmlObject  instanceof NameIdentifier) {
+                        final NameIdentifier nameIdentifier = (NameIdentifier) xmlObject; 
+                        if (SAML1ObjectSupport.areNameIdentifierFormatsEquivalent(getFormat(),
+                                nameIdentifier.getFormat())) {
+                            log.info("Returning NameIdentifier from XMLObject-valued attribute {}", sourceId);
+                            return nameIdentifier;
+                        } else {
+                            log.debug("Attribute {} value was NameIdentifier, but Format did not match", sourceId);
+                        }
                     }
                 }
             }
@@ -207,7 +212,7 @@ public class AttributeSourcedSAML1NameIdentifierGenerator extends AbstractSAML1N
                     return ((ScopedStringAttributeValue) value).getValue() + delimiter
                             + ((ScopedStringAttributeValue) value).getScope();
                 } else if (value instanceof StringAttributeValue) {
-                    final String strVal = StringSupport.trimOrNull((String) value.getValue());
+                    final String strVal = StringSupport.trimOrNull(((StringAttributeValue) value).getValue());
                     if (strVal == null) {
                         log.debug("Skipping all-whitespace string value");
                         continue;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java
index 94cbdba..865d5a4 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGenerator.java
@@ -166,11 +166,12 @@ public class AttributeSourcedSAML2NameIDGenerator extends AbstractSAML2NameIDGen
 
             final List<IdPAttributeValue> values = attribute.getValues();
             for (final IdPAttributeValue value : values) {
-                if (value instanceof XMLObjectAttributeValue && value.getValue() instanceof NameID) {
+                if (value instanceof XMLObjectAttributeValue &&
+                        ((XMLObjectAttributeValue) value).getValue() instanceof NameID) {
                     if (SAML2ObjectSupport.areNameIDFormatsEquivalent(getFormat(),
-                            ((NameID) value.getValue()).getFormat())) {
+                            ((NameID) ((XMLObjectAttributeValue) value).getValue()).getFormat())) {
                         log.info("Returning NameID from XMLObject-valued attribute {}", sourceId);
-                        return (NameID) value.getValue();
+                        return (NameID) ((XMLObjectAttributeValue) value).getValue();
                     } else {
                         log.debug("Attribute {} value was NameID, but Format did not match", sourceId);
                     }
@@ -207,7 +208,7 @@ public class AttributeSourcedSAML2NameIDGenerator extends AbstractSAML2NameIDGen
                     return ((ScopedStringAttributeValue) value).getValue() + delimiter
                             + ((ScopedStringAttributeValue) value).getScope();
                 } else if (value instanceof StringAttributeValue) {
-                    final String strVal = StringSupport.trimOrNull((String) value.getValue());
+                    final String strVal = StringSupport.trimOrNull(((StringAttributeValue) value).getValue());
                     if (strVal == null) {
                         log.debug("Skipping all-whitespace string value");
                         continue;
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java
index f278446..5c4e665 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/nameid/impl/PersistentSAML2NameIDGenerator.java
@@ -256,12 +256,12 @@ public class PersistentSAML2NameIDGenerator extends AbstractSAML2NameIDGenerator
                         return pid.getPairwiseId();
                     } else if (value instanceof StringAttributeValue) {
                         // Check for all whitespace, but don't trim the value used.
-                        if (StringSupport.trimOrNull((String) value.getValue()) == null) {
+                        if (StringSupport.trimOrNull(((StringAttributeValue) value).getValue()) == null) {
                             log.debug("Skipping all-whitespace string value");
                             continue;
                         }
                         log.debug("Generating persistent NameID from String-valued attribute {}", sourceId);
-                        pid.setSourceSystemId((String) value.getValue());
+                        pid.setSourceSystemId(((StringAttributeValue) value).getValue());
                         pid = pidStore.getBySourceValue(pid, true);
                         return pid.getPairwiseId();
                     } else {
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1ByteAttributeTranscoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1ByteAttributeTranscoderTest.java
index 78e3ede..b1c3e4b 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1ByteAttributeTranscoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1ByteAttributeTranscoderTest.java
@@ -268,7 +268,7 @@ public class SAML1ByteAttributeTranscoderTest extends OpenSAMLInitBaseTestCase {
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue(), BYTE_ARRAY_1);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(0)).getValue(), BYTE_ARRAY_1);
     }
 
     @Test(expectedExceptions = {AttributeDecodingException.class,}) public void badDecode() throws Exception {
@@ -361,8 +361,8 @@ public class SAML1ByteAttributeTranscoderTest extends OpenSAMLInitBaseTestCase {
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 2);
-        Assert.assertEquals(attr.getValues().get(0).getValue(), BYTE_ARRAY_1);
-        Assert.assertEquals(attr.getValues().get(1).getValue(), BYTE_ARRAY_2);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(0)).getValue(), BYTE_ARRAY_1);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(1)).getValue(), BYTE_ARRAY_2);
     }
 
 }
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1StringAttributeTranscoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1StringAttributeTranscoderTest.java
index 8ad64fb..8c3d572 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1StringAttributeTranscoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML1StringAttributeTranscoderTest.java
@@ -265,7 +265,7 @@ public class SAML1StringAttributeTranscoderTest extends OpenSAMLInitBaseTestCase
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
     }
         
     @Test public void multi() throws Exception {
@@ -320,8 +320,8 @@ public class SAML1StringAttributeTranscoderTest extends OpenSAMLInitBaseTestCase
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 2);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
-        Assert.assertEquals(attr.getValues().get(1).getValue().toString(), STRING_2);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(1)).getValue().toString(), STRING_2);
     }
 
 }
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2ByteAttributeTranscoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2ByteAttributeTranscoderTest.java
index 2a21fe1..7493ab4 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2ByteAttributeTranscoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2ByteAttributeTranscoderTest.java
@@ -24,6 +24,21 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.opensaml.core.OpenSAMLInitBaseTestCase;
+import org.opensaml.core.xml.XMLObject;
+import org.opensaml.core.xml.XMLObjectBuilder;
+import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
+import org.opensaml.core.xml.schema.XSBase64Binary;
+import org.opensaml.core.xml.schema.XSString;
+import org.opensaml.saml.common.SAMLObjectBuilder;
+import org.opensaml.saml.saml2.core.Attribute;
+import org.opensaml.saml.saml2.core.AttributeValue;
+import org.opensaml.saml.saml2.metadata.RequestedAttribute;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
 import net.shibboleth.idp.attribute.AttributeDecodingException;
 import net.shibboleth.idp.attribute.AttributeEncodingException;
 import net.shibboleth.idp.attribute.ByteAttributeValue;
@@ -42,21 +57,6 @@ import net.shibboleth.idp.saml.attribute.transcoding.SAMLAttributeTranscoder;
 import net.shibboleth.utilities.java.support.codec.Base64Support;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 
-import org.opensaml.core.OpenSAMLInitBaseTestCase;
-import org.opensaml.core.xml.XMLObject;
-import org.opensaml.core.xml.XMLObjectBuilder;
-import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
-import org.opensaml.core.xml.schema.XSBase64Binary;
-import org.opensaml.core.xml.schema.XSString;
-import org.opensaml.saml.common.SAMLObjectBuilder;
-import org.opensaml.saml.saml2.core.Attribute;
-import org.opensaml.saml.saml2.core.AttributeValue;
-import org.opensaml.saml.saml2.metadata.RequestedAttribute;
-import org.testng.Assert;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
 /** {@link SAML2ByteAttributeTranscoder} unit test. */
 public class SAML2ByteAttributeTranscoderTest extends OpenSAMLInitBaseTestCase {
 
@@ -281,7 +281,7 @@ public class SAML2ByteAttributeTranscoderTest extends OpenSAMLInitBaseTestCase {
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue(), BYTE_ARRAY_1);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(0)).getValue(), BYTE_ARRAY_1);
     }
     
     @Test(expectedExceptions = {AttributeDecodingException.class,}) public void badDecode() throws Exception {
@@ -322,7 +322,7 @@ public class SAML2ByteAttributeTranscoderTest extends OpenSAMLInitBaseTestCase {
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertTrue(((IdPRequestedAttribute) attr).getIsRequired());
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue(), BYTE_ARRAY_1);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(0)).getValue(), BYTE_ARRAY_1);
     }
     
     @Test public void multi() throws Exception {
@@ -398,8 +398,8 @@ public class SAML2ByteAttributeTranscoderTest extends OpenSAMLInitBaseTestCase {
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 2);
-        Assert.assertEquals(attr.getValues().get(0).getValue(), BYTE_ARRAY_1);
-        Assert.assertEquals(attr.getValues().get(1).getValue(), BYTE_ARRAY_2);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(0)).getValue(), BYTE_ARRAY_1);
+        Assert.assertEquals(((ByteAttributeValue)attr.getValues().get(1)).getValue(), BYTE_ARRAY_2);
     }
 
 }
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2StringAttributeTranscoderTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2StringAttributeTranscoderTest.java
index 85d3240..4062799 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2StringAttributeTranscoderTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2StringAttributeTranscoderTest.java
@@ -277,7 +277,7 @@ public class SAML2StringAttributeTranscoderTest extends OpenSAMLInitBaseTestCase
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
     }
     
     
@@ -302,7 +302,7 @@ public class SAML2StringAttributeTranscoderTest extends OpenSAMLInitBaseTestCase
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertTrue(((IdPRequestedAttribute) attr).getIsRequired());
         Assert.assertEquals(attr.getValues().size(), 1);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
     }
     
     @Test public void multi() throws Exception {
@@ -357,8 +357,8 @@ public class SAML2StringAttributeTranscoderTest extends OpenSAMLInitBaseTestCase
         Assert.assertNotNull(attr);
         Assert.assertEquals(attr.getId(), ATTR_NAME);
         Assert.assertEquals(attr.getValues().size(), 2);
-        Assert.assertEquals(attr.getValues().get(0).getValue().toString(), STRING_1);
-        Assert.assertEquals(attr.getValues().get(1).getValue().toString(), STRING_2);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(0)).getValue().toString(), STRING_1);
+        Assert.assertEquals(((StringAttributeValue)attr.getValues().get(1)).getValue().toString(), STRING_2);
     }
 
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list