summaryrefslogtreecommitdiffstats
path: root/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-application/src/main
diff options
context:
space:
mode:
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;
}
}