-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Fix & Enhancement #2687
Merged
Merged
Bug Fix & Enhancement #2687
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a874554
Polish apache/incubator-dubbo#2235 apache/incubator-dubbo#2251 apache…
mercyblitz b3dbe9e
Fixed bugs and optimized imports
mercyblitz fa967c6
Remove local PropertySourcesUtils and re-use it from spring-context-e…
mercyblitz cb7da3e
Add Test cases for YAML properties
mercyblitz e507afb
Optimize imports using code-style template
mercyblitz be3de0c
Refactor Utilities class
mercyblitz 88219e7
Fixed test cases
mercyblitz 13e03a8
Merge remote-tracking branch 'upstream/2.6.x' into 2.6.5
mercyblitz 60050ac
[Enhancement] @EnableDubboConfigBinding annotates @Repeatable apache/…
mercyblitz 48a1f56
Bug fix
mercyblitz e33d3df
Remove feature :
mercyblitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
import com.alibaba.dubbo.config.AbstractConfig; | ||
import com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.springframework.beans.factory.config.BeanDefinition; | ||
|
@@ -40,8 +41,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; | ||
|
||
|
@@ -85,7 +86,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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why modify type? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's better for binding, |
||
|
||
if (CollectionUtils.isEmpty(properties)) { | ||
if (log.isDebugEnabled()) { | ||
|
@@ -157,7 +158,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>(); | ||
|
||
|
@@ -178,10 +179,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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to not depend on alibaba's spring-context-support, or consider to directly include its source in Dubbo.