summaryrefslogtreecommitdiffstats
path: root/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
diff options
context:
space:
mode:
authormichal.banka <michal.banka@nokia.com>2019-07-16 13:51:00 +0200
committerTomasz Golabek <tomasz.golabek@nokia.com>2019-07-17 08:21:51 +0000
commit8a894e564dc7577d78273c890396ffb5dbe86bbb (patch)
treef351e0aaa9e4f6ca0bcaad80ab04c9084c905f55 /common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
parenta51eac038c8896b2413d0c57e223d49870fd1079 (diff)
Fix checkstyle violations in sdc-main/common
Change-Id: I3e132cf4bffd77f9910bf6eff2026c3267873b11 Issue-ID: SDC-2454 Signed-off-by: michal.banka <michal.banka@nokia.com>
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
index 6cad62ef03..9a3fbd26fb 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/main/java/org/onap/config/impl/ConfigurationImpl.java
@@ -44,7 +44,7 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
private static final String KEY_CANNOT_BE_NULL = "Key can't be null.";
- private static final NonConfigResource nonConfigResource = new NonConfigResource();
+ private static final NonConfigResource NON_CONFIG_RESOURCE = new NonConfigResource();
static {
@@ -70,7 +70,7 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
}
moduleConfig.addConfig(url);
} else {
- nonConfigResource.add(url);
+ NON_CONFIG_RESOURCE.add(url);
}
}
String configLocation = System.getProperty("config.location");
@@ -88,7 +88,7 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
}
moduleConfig.addConfig(file);
} else {
- nonConfigResource.add(file);
+ NON_CONFIG_RESOURCE.add(file);
}
}
}
@@ -397,13 +397,17 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
clazzToInstantiate = field.getType();
}
Constructor construct = getConstructorWithArguments(clazzToInstantiate, Collection.class);
+
if (construct != null) {
construct.setAccessible(true);
field.set(objToReturn, construct.newInstance(list));
- } else if ((construct = getConstructorWithArguments(clazzToInstantiate, Integer.class,
- Boolean.class, Collection.class)) != null) {
- construct.setAccessible(true);
- field.set(objToReturn, construct.newInstance(list.size(), true, list));
+ } else {
+ construct = getConstructorWithArguments(clazzToInstantiate, Integer.class,
+ Boolean.class, Collection.class);
+ if (construct != null) {
+ construct.setAccessible(true);
+ field.set(objToReturn, construct.newInstance(list.size(), true, list));
+ }
}
}
} else if (Map.class.isAssignableFrom(field.getType())) {
@@ -454,7 +458,7 @@ public class ConfigurationImpl implements org.onap.config.api.Configuration {
if (String.class.equals(clazz)) {
if (obj.toString().startsWith("@") && ConfigurationUtils.isExternalLookup(processingHint)) {
String contents = ConfigurationUtils.getFileContents(
- nonConfigResource.locate(obj.toString().substring(1).trim()));
+ NON_CONFIG_RESOURCE.locate(obj.toString().substring(1).trim()));
if (contents == null) {
contents = ConfigurationUtils.getFileContents(obj.toString().substring(1).trim());
}