[java-opensaml] branch master updated: JSPT-79 - Review date and time handling for Java 8

Scott Cantor cantor.2 at osu.edu
Wed Mar 20 14:31:55 EDT 2019


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

scantor pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=44ee710b5c0fc5054d1d2bcea44004f72a472344

The following commit(s) were added to refs/heads/master by this push:
       new  44ee710   JSPT-79 - Review date and time handling for Java 8
44ee710 is described below

commit 44ee710b5c0fc5054d1d2bcea44004f72a472344
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Mar 20 14:31:53 2019 -0400

    JSPT-79 - Review date and time handling for Java 8
    
    https://issues.shibboleth.net/jira/browse/JSPT-79
    
    Stragglers still parsing Instant wrong.
---
 .../opensaml/saml/ext/saml2mdrpi/impl/PublicationUnmarshaller.java  | 6 +++---
 .../opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java   | 4 +---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationUnmarshaller.java
index b260de4..3631408 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/ext/saml2mdrpi/impl/PublicationUnmarshaller.java
@@ -17,14 +17,14 @@
 
 package org.opensaml.saml.ext.saml2mdrpi.impl;
 
-import java.time.Instant;
-
 import org.opensaml.core.xml.XMLObject;
 import org.opensaml.core.xml.io.UnmarshallingException;
 import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
 import org.opensaml.saml.ext.saml2mdrpi.Publication;
 import org.w3c.dom.Attr;
 
+import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+
 /**
  * An unmarshaller for {@link Publication}.
  */
@@ -38,7 +38,7 @@ public class PublicationUnmarshaller extends AbstractSAMLObjectUnmarshaller {
             if (Publication.PUBLISHER_ATTRIB_NAME.equals(attribute.getName())) {
                 info.setPublisher(attribute.getValue());
             } else if (Publication.CREATION_INSTANT_ATTRIB_NAME.equals(attribute.getName())) {
-                info.setCreationInstant(Instant.parse(attribute.getValue()));
+                info.setCreationInstant(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
             } else if (Publication.PUBLICATION_ID_ATTRIB_NAME.equals(attribute.getName())) {
                 info.setPublicationId(attribute.getValue());
             } else {
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java
index b15a082..cd43b11 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/saml2/core/impl/AuthnStatementUnmarshaller.java
@@ -21,8 +21,6 @@
 
 package org.opensaml.saml.saml2.core.impl;
 
-import java.time.Instant;
-
 import org.opensaml.core.xml.XMLObject;
 import org.opensaml.core.xml.io.UnmarshallingException;
 import org.opensaml.saml.common.AbstractSAMLObjectUnmarshaller;
@@ -65,7 +63,7 @@ public class AuthnStatementUnmarshaller extends AbstractSAMLObjectUnmarshaller {
                 authnStatement.setSessionIndex(attribute.getValue());
             } else if (attribute.getLocalName().equals(AuthnStatement.SESSION_NOT_ON_OR_AFTER_ATTRIB_NAME)
                     && !Strings.isNullOrEmpty(attribute.getValue())) {
-                authnStatement.setSessionNotOnOrAfter(Instant.parse(attribute.getValue()));
+                authnStatement.setSessionNotOnOrAfter(DOMTypeSupport.dateTimeToInstant(attribute.getValue()));
             } else {
                 super.processAttribute(samlObject, attribute);
             }

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


More information about the commits mailing list