[java-opensaml] 17/24: Move all possible code into try block of reloading resolver refresh().

Brent Putman putmanb at georgetown.edu
Wed Sep 27 16:46:11 EDT 2017


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

putmanb pushed a commit to branch maint-3.3
in repository java-opensaml.

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

commit ae86273db6c167c32ab0d16ced7a0021fd1b932e
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Wed Aug 16 17:45:58 2017 -0400

    Move all possible code into try block of reloading resolver refresh().
    
    It's really, really extremely unlikely that new-ing a DateTime
    or a logging call could throw, but let's be absolutely positively
    on the safe side, since otherwise the consequences will be that the
    next refresh will not be scheduled.
    
    Conflicts:
      opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractReloadingMetadataResolver.java
---
 .../resolver/impl/AbstractReloadingMetadataResolver.java       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractReloadingMetadataResolver.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractReloadingMetadataResolver.java
index e309232..4ab0238 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractReloadingMetadataResolver.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractReloadingMetadataResolver.java
@@ -277,11 +277,15 @@ public abstract class AbstractReloadingMetadataResolver extends AbstractBatchMet
      */
     @Override
     public synchronized void refresh() throws ResolverException {
-        final DateTime now = new DateTime(ISOChronology.getInstanceUTC());
-        final String mdId = getMetadataIdentifier();
+        DateTime now = null;
+        String mdId = null;
 
-        log.debug("{} Beginning refresh of metadata from '{}'", getLogPrefix(), mdId);
         try {
+            now = new DateTime(ISOChronology.getInstanceUTC());
+            mdId = getMetadataIdentifier();
+
+            log.debug("{} Beginning refresh of metadata from '{}'", getLogPrefix(), mdId);
+        
             final byte[] mdBytes = fetchMetadata();
             if (mdBytes == null) {
                 log.debug("{} Metadata from '{}' has not changed since last refresh", getLogPrefix(), mdId);

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


More information about the commits mailing list