summaryrefslogtreecommitdiffstats
path: root/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2023-01-25 11:47:41 +0000
committerwaqas.ikram <waqas.ikram@est.tech>2023-01-25 11:48:27 +0000
commit7d2b19e9b65c045675381b5f352e67650bdd068d (patch)
tree012fafa513f01286ba7d93ed75cdee290b6c8eef /so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main
parent04798df78d921a3fc32997286167f2917aece225 (diff)
Adding support for registration of kubernetes
clusters and fixing code smells Change-Id: I2d10c263e255ca8644539de9c47c9a4fed04997f Issue-ID: SO-4050 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main')
-rw-r--r--so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main/java/org/onap/so/cnfm/lcm/app/DefaultToShortClassNameBeanNameGenerator.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main/java/org/onap/so/cnfm/lcm/app/DefaultToShortClassNameBeanNameGenerator.java b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main/java/org/onap/so/cnfm/lcm/app/DefaultToShortClassNameBeanNameGenerator.java
index dbf5e02..2683b03 100644
--- a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main/java/org/onap/so/cnfm/lcm/app/DefaultToShortClassNameBeanNameGenerator.java
+++ b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main/java/org/onap/so/cnfm/lcm/app/DefaultToShortClassNameBeanNameGenerator.java
@@ -19,6 +19,8 @@
*/
package org.onap.so.cnfm.lcm.app;
+import static org.slf4j.LoggerFactory.getLogger;
+import org.slf4j.Logger;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.AnnotationBeanNameGenerator;
import org.springframework.util.ClassUtils;
@@ -28,9 +30,14 @@ import org.springframework.util.ClassUtils;
*
*/
public class DefaultToShortClassNameBeanNameGenerator extends AnnotationBeanNameGenerator {
+ private static final Logger logger = getLogger(DefaultToShortClassNameBeanNameGenerator.class);
@Override
protected String buildDefaultBeanName(final BeanDefinition definition) {
- return ClassUtils.getShortName(definition.getBeanClassName());
+ if (definition.getBeanClassName() != null) {
+ return ClassUtils.getShortName(definition.getBeanClassName());
+ }
+ logger.warn("Bean class name is not specified...");
+ return null;
}
}