diff options
Diffstat (limited to 'container-di')
-rw-r--r-- | container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java b/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java index bd3d146cfec..1133363be8e 100644 --- a/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java +++ b/container-di/src/main/java/com/yahoo/container/di/CloudSubscriberFactory.java @@ -103,29 +103,27 @@ public class CloudSubscriberFactory implements SubscriberFactory { @Override public long waitNextGeneration() { - if (handles.isEmpty()) { + if (handles.isEmpty()) throw new IllegalStateException("No config keys registered"); - } - /* Catch and just log config exceptions due to missing config values for parameters that do - * not have a default value. These exceptions occur when the user has removed a component - * from services.xml, and the component takes a config that has parameters without a - * default value in the def-file. There is a new 'components' config underway, where the - * component is removed, so this old config generation will soon be replaced by a new one. */ + // Catch and just log config exceptions due to missing config values for parameters that do + // not have a default value. These exceptions occur when the user has removed a component + // from services.xml, and the component takes a config that has parameters without a + // default value in the def-file. There is a new 'components' config underway, where the + // component is removed, so this old config generation will soon be replaced by a new one. boolean gotNextGen = false; int numExceptions = 0; while ( ! gotNextGen) { try { - if (subscriber.nextGeneration()) { + if (subscriber.nextGeneration()) gotNextGen = true; - } - } catch (IllegalArgumentException e) { + } + catch (IllegalArgumentException e) { numExceptions++; - log.log(Level.WARNING, "Got exception from the config system (please ignore the exception if you just removed " - + "a component from your application that used the mentioned config): ", e); - if (numExceptions >= 5) { - throw new IllegalArgumentException("Failed retrieving the next config generation.", e); - } + log.log(Level.WARNING, "Got exception from the config system (ignore if you just removed a " + + "component from your application that used the mentioned config): ", e); + if (numExceptions >= 5) + throw new IllegalArgumentException("Failed retrieving the next config generation", e); } } |