[java-identity-provider COMMIT] /trunk/idp-attribute-mapper-api/src/main/java/net/shibboleth/idp/attribute/mapper/Abs...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Sep 19 13:09:50 EDT 2013
Author: rdw
Date: Thu Sep 19 13:09:50 2013
New Revision: 4782
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4782&view=rev
Log:
Finish review driven tidy up now I can turn off CS warnings.
Modified:
trunk/idp-attribute-mapper-api/src/main/java/net/shibboleth/idp/attribute/mapper/AbstractSAMLAttributeValueMapper.java
Modified: trunk/idp-attribute-mapper-api/src/main/java/net/shibboleth/idp/attribute/mapper/AbstractSAMLAttributeValueMapper.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-mapper-api/src/main/java/net/shibboleth/idp/attribute/mapper/AbstractSAMLAttributeValueMapper.java?rev=4782&r1=4781&r2=4782&view=diff
==============================================================================
--- trunk/idp-attribute-mapper-api/src/main/java/net/shibboleth/idp/attribute/mapper/AbstractSAMLAttributeValueMapper.java (original)
+++ trunk/idp-attribute-mapper-api/src/main/java/net/shibboleth/idp/attribute/mapper/AbstractSAMLAttributeValueMapper.java Thu Sep 19 13:09:50 2013
@@ -81,6 +81,7 @@
* @param object The object to inspect.
* @return Its contents suitably decoded. Returns null if we could not decode.
*/
+ // Checkstyle: CyclomaticComplexity OFF
@Nullable protected String getStringValue(@Nonnull final XMLObject object) {
String retVal = null;
@@ -101,26 +102,7 @@
retVal = ((XSInteger) object).getValue().toString();
- } else {
-
- retVal = decodeComplex(object);
- }
-
- if (null == retVal) {
- log.info("{} value of type {} could not be converted", getLogPrefix(), object.getClass().toString());
- }
- return retVal;
- }
-
- /**
- * Helper function for decodeValue. Only here because checkstyle needs it. (TODO)
- * @param object the object to look at
- * @return a string, if conversion possible, null otherwise
- */
- @Nullable private String decodeComplex(@Nonnull XMLObject object) {
- String retVal = null;
-
- if (object instanceof XSDateTime) {
+ } else if (object instanceof XSDateTime) {
final DateTime dt = ((XSDateTime) object).getValue();
if (dt != null) {
@@ -142,8 +124,13 @@
retVal = null;
}
}
+
+ if (null == retVal) {
+ log.info("{} value of type {} could not be converted", getLogPrefix(), object.getClass().toString());
+ }
return retVal;
}
+ // Checkstyle: CyclomaticComplexity ON
/**
* Return a string which is to be prepended to all log messages. This is set by the enclosing AttributeMapper.
More information about the commits
mailing list