Skip to content

Commit

Permalink
Poblish apache#2297
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Aug 14, 2018
1 parent 593ce64 commit c0928d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
import java.util.Map;
import java.util.Set;

import static com.alibaba.dubbo.config.spring.util.PropertySourcesUtils.getSubProperties;
import static com.alibaba.dubbo.config.spring.util.PropertySourcesUtils.normalizePrefix;
import static com.alibaba.spring.util.PropertySourcesUtils.getSubProperties;
import static com.alibaba.spring.util.PropertySourcesUtils.normalizePrefix;
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
import static org.springframework.beans.factory.support.BeanDefinitionReaderUtils.registerWithGeneratedName;

Expand Down Expand Up @@ -85,7 +85,7 @@ private void registerDubboConfigBeans(String prefix,
boolean multiple,
BeanDefinitionRegistry registry) {

Map<String, String> properties = getSubProperties(environment.getPropertySources(), prefix);
Map<String, Object> properties = getSubProperties(environment.getPropertySources(), prefix);

if (CollectionUtils.isEmpty(properties)) {
if (log.isDebugEnabled()) {
Expand Down Expand Up @@ -157,7 +157,7 @@ public void setEnvironment(Environment environment) {

}

private Set<String> resolveMultipleBeanNames(Map<String, String> properties) {
private Set<String> resolveMultipleBeanNames(Map<String, Object> properties) {

Set<String> beanNames = new LinkedHashSet<String>();

Expand All @@ -178,10 +178,10 @@ private Set<String> resolveMultipleBeanNames(Map<String, String> properties) {

}

private String resolveSingleBeanName(Map<String, String> properties, Class<? extends AbstractConfig> configClass,
private String resolveSingleBeanName(Map<String, Object> properties, Class<? extends AbstractConfig> configClass,
BeanDefinitionRegistry registry) {

String beanName = properties.get("id");
String beanName = (String) properties.get("id");

if (!StringUtils.hasText(beanName)) {
BeanDefinitionBuilder builder = rootBeanDefinition(configClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import java.util.Map;

import static com.alibaba.dubbo.config.spring.util.PropertySourcesUtils.getSubProperties;
import static com.alibaba.spring.util.PropertySourcesUtils.getSubProperties;

/**
* Default {@link DubboConfigBinder} implementation based on Spring {@link DataBinder}
Expand All @@ -36,7 +36,7 @@ public <C extends AbstractConfig> void bind(String prefix, C dubboConfig) {
dataBinder.setIgnoreInvalidFields(isIgnoreInvalidFields());
dataBinder.setIgnoreUnknownFields(isIgnoreUnknownFields());
// Get properties under specified prefix from PropertySources
Map<String, String> properties = getSubProperties(getPropertySources(), prefix);
Map<String, Object> properties = getSubProperties(getPropertySources(), prefix);
// Convert Map to MutablePropertyValues
MutablePropertyValues propertyValues = new MutablePropertyValues(properties);
// Bind
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit c0928d8

Please sign in to comment.