[java-opensaml COMMIT] /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynam...

noreply at shibboleth.net noreply at shibboleth.net
Wed Oct 5 16:51:34 EDT 2016


Author: putmanb
Date: Wed Oct  5 16:51:34 2016
New Revision: 4513

URL: http://svn.shibboleth.net/view/java-opensaml?rev=4513&view=rev
Log:
Make intent of conditional code more clear, similar to previous checkin.

Modified:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynamicMetadataResolver.java

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynamicMetadataResolver.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynamicMetadataResolver.java?rev=4513&r1=4512&r2=4513&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynamicMetadataResolver.java	(original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/impl/AbstractDynamicMetadataResolver.java	Wed Oct  5 16:51:34 2016
@@ -432,16 +432,14 @@
             // It's possible that multiple threads fall into here and attempt to preemptively refresh. 
             // This check should ensure that only 1 actually successfully does it, b/c the refresh
             // trigger time will be updated as seen by the subsequent ones. 
-            if (!shouldAttemptRefresh(mgmtData)) {
-                final List<EntityDescriptor> descriptors = lookupEntityID(entityID);
-                if (!descriptors.isEmpty()) {
-                    log.debug("Metadata was resolved and stored by another thread " 
-                            + "while this thread was waiting on the write lock");
-                    return descriptors;
-                }
-            }
-            
-            log.debug("Resolving metadata dynamically for entity ID: {}", entityID);
+            final List<EntityDescriptor> descriptors = lookupEntityID(entityID);
+            if (!descriptors.isEmpty() && !shouldAttemptRefresh(mgmtData)) {
+                log.debug("Metadata was resolved and stored by another thread " 
+                        + "while this thread was waiting on the write lock");
+                return descriptors;
+            } else {
+                log.debug("Resolving metadata dynamically for entity ID: {}", entityID);
+            }
             
             final XMLObject root = fetchFromOriginSource(criteria);
             if (root == null) {



More information about the commits mailing list