summaryrefslogtreecommitdiffstats
path: root/common/openecomp-common-configuration-management
diff options
context:
space:
mode:
Diffstat (limited to 'common/openecomp-common-configuration-management')
-rw-r--r--common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/AggregateConfiguration.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/AggregateConfiguration.java b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/AggregateConfiguration.java
index de5a189775..e67de752ec 100644
--- a/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/AggregateConfiguration.java
+++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-core/src/main/java/org/openecomp/config/impl/AggregateConfiguration.java
@@ -24,10 +24,18 @@ public final class AggregateConfiguration {
private Map<String, Configuration> mergeConfig = new HashMap<>();
private Map<String, Configuration> overrideConfig = new LinkedHashMap<>();
- {
- if (!Thread.currentThread().getStackTrace()[2].getClassName()
- .equals(ConfigurationImpl.class.getName())) {
- throw new RuntimeException("Illegal access.");
+ /**
+ * Instantiates a new Aggregate configuration.
+ */
+ public AggregateConfiguration() {
+ try {
+ Class clazz = Class.forName(Thread.currentThread().getStackTrace()[2].getClassName());
+ if (!clazz.getCanonicalName()
+ .equals(ConfigurationImpl.class.getCanonicalName())) {
+ throw new RuntimeException("Illegal access.");
+ }
+ } catch (ClassNotFoundException cfe) {
+ throw new RuntimeException("Class not found while loading change notifier");
}
}