From c21cc05ec9ff4f96f34af9027714bb525cd0edf5 Mon Sep 17 00:00:00 2001 From: vkeeper Date: Wed, 31 Oct 2018 11:29:54 +0800 Subject: [PATCH] replace ServiceAnnotationBeanPostProcessor log.isInfoEnabled->log.isWarnEnabled (#2712) simplify ExtensionLoader code segment --- .../dubbo/common/extension/ExtensionLoader.java | 15 ++------------- .../ServiceAnnotationBeanPostProcessor.java | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java index 75b7562398e..1d071a1551c 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java @@ -860,19 +860,8 @@ private String createAdaptiveExtensionClassCode() { String[] value = adaptiveAnnotation.value(); // value is not set, use the value generated from class name as the key if (value.length == 0) { - char[] charArray = type.getSimpleName().toCharArray(); - StringBuilder sb = new StringBuilder(128); - for (int i = 0; i < charArray.length; i++) { - if (Character.isUpperCase(charArray[i])) { - if (i != 0) { - sb.append("."); - } - sb.append(Character.toLowerCase(charArray[i])); - } else { - sb.append(charArray[i]); - } - } - value = new String[]{sb.toString()}; + String splitName = StringUtils.camelToSplitName(type.getSimpleName(), "."); + value = new String[]{splitName}; } boolean hasInvocation = false; diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java index 389ef217367..0558528f61b 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java @@ -261,7 +261,7 @@ private void registerServiceBean(BeanDefinitionHolder beanDefinitionHolder, Bean if (scanner.checkCandidate(beanName, serviceBeanDefinition)) { // check duplicated candidate bean registry.registerBeanDefinition(beanName, serviceBeanDefinition); - if (logger.isInfoEnabled()) { + if (logger.isWarnEnabled()) { logger.warn("The BeanDefinition[" + serviceBeanDefinition + "] of ServiceBean has been registered with name : " + beanName); }