[java-identity-provider] 04/05: IDP-1595 Resource construction can throw an exception

Rod Widdowson rdw at steadingsoftware.com
Tue May 19 10:14:15 UTC 2020


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

rdw pushed a commit to branch dev/IDP-1595
in repository java-identity-provider.

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

commit e10d8be60d26c4d8a7d90594ae4b631149ddf3f4
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu May 14 11:00:51 2020 +0100

    IDP-1595 Resource construction can throw an exception
    
    https://issues.shibboleth.net/jira/browse/IDP-1595
---
 .../idp/installer/plugin/impl/PluginState.java     | 34 +++++++++++++---------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java
index 0b1143093..b5e883112 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginState.java
@@ -199,22 +199,28 @@ public final class PluginState extends AbstractInitializableComponent {
     /** {@inheritDoc} */
     protected void doInitialize() throws ComponentInitializationException {
         
-        for (final Resource parent:plugin.getUpdateResources()) {
-           
-            log.debug("Plugin {}: Looking for update at {}", plugin.getPluginId(), parent.getDescription());
-            if (!parent.exists()) {
-                log.info("Plugin {}: {} could not be located", plugin.getPluginId(), parent.getDescription());
-                continue;
-            }
-            
-            if (populate(parent)) { 
-                log.debug("Plugin {}: PluginState populated from {}", plugin.getPluginId(), parent.getDescription());
-                if (myVersionInfo == null) {
-                    log.error("Plugin {} : Could not find version {} in descriptions at {}",
-                            plugin.getPluginId(), myPluginVersion, parent.getDescription());
+        try {
+            for (final Resource parent:plugin.getUpdateResources()) {
+               
+                log.debug("Plugin {}: Looking for update at {}", plugin.getPluginId(), parent.getDescription());
+                if (!parent.exists()) {
+                    log.info("Plugin {}: {} could not be located", plugin.getPluginId(), parent.getDescription());
+                    continue;
+                }
+                
+                if (populate(parent)) { 
+                    log.debug("Plugin {}: PluginState populated from {}",
+                            plugin.getPluginId(), parent.getDescription());
+                    if (myVersionInfo == null) {
+                        log.error("Plugin {} : Could not find version {} in descriptions at {}",
+                                plugin.getPluginId(), myPluginVersion, parent.getDescription());
+                    }
+                    return;
                 }
-                return;
             }
+        } catch (final IOException e) {
+            throw new ComponentInitializationException("Could not locate Update Resource for "
+                        + plugin.getPluginId(), e);
         }
         log.warn("Plugin {}: No available servers found.");
         throw new ComponentInitializationException("Could not locate information for " + plugin.getPluginId());

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


More information about the commits mailing list