Skip to content

Commit

Permalink
Polish /#3193 : Change the default behavior of @EnableDubboConfig.mul…
Browse files Browse the repository at this point in the history
…tiple()
  • Loading branch information
mercyblitz committed Mar 15, 2019
1 parent a8112d2 commit 90466a5
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 @@ -75,6 +75,6 @@
* @return the default value is <code>false</code>
* @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 @@ -95,13 +94,13 @@ public void testMultiple() {

}

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

}

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

Expand Down

0 comments on commit 90466a5

Please sign in to comment.