Skip to content

Commit

Permalink
Polish apache#3193 : Change the default behavior of @EnableDubboConfi…
Browse files Browse the repository at this point in the history
…g.multiple()
  • Loading branch information
mercyblitz committed Mar 14, 2019
1 parent 438b50b commit b4f783b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Expand Up @@ -44,10 +44,11 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, B

boolean multiple = attributes.getBoolean("multiple");

if (multiple) {
// Single Config Bindings
registerBeans(registry, DubboConfigConfiguration.Single.class);

if (multiple) { // Since 2.6.6 https://github.com/apache/incubator-dubbo/issues/3193
registerBeans(registry, DubboConfigConfiguration.Multiple.class);
} else {
registerBeans(registry, DubboConfigConfiguration.Single.class);
}
}

Expand Down
Expand Up @@ -76,6 +76,6 @@
* @see EnableDubboConfig#multiple()
*/
@AliasFor(annotation = EnableDubboConfig.class, attribute = "multiple")
boolean multipleConfig() default false;
boolean multipleConfig() default true;

}
Expand Up @@ -59,7 +59,7 @@
*
* @see EnableDubboConfigBinding
* @see DubboConfigConfiguration
* @see DubboConfigConfigurationSelector
* @see DubboConfigConfigurationRegistrar
* @since 2.5.8
*/
@Target({ElementType.TYPE})
Expand All @@ -72,9 +72,9 @@
/**
* It indicates whether binding to multiple Spring Beans.
*
* @return the default value is <code>false</code>
* @return the default value is <code>true</code> since 2.6.6, the value is inverse earlier.
* @revised 2.5.9
*/
boolean multiple() default false;
boolean multiple() default true;

}
Expand Up @@ -26,7 +26,6 @@

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.PropertySource;

Expand Down Expand Up @@ -101,7 +100,7 @@ private static class TestMultipleConfig {

}

@EnableDubboConfig
@EnableDubboConfig(multiple = false)
@PropertySource("META-INF/config.properties")
private static class TestConfig {

Expand Down

0 comments on commit b4f783b

Please sign in to comment.