Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
c567bdd2
Commit
c567bdd2
authored
Mar 06, 2017
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for Spring 4.1.2 that composite property source should extend EnumerablePropertySource
parent
6015c757
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
ConfigPropertySource.java
.../framework/apollo/spring/config/ConfigPropertySource.java
+15
-3
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/spring/config/ConfigPropertySource.java
View file @
c567bdd2
package
com
.
ctrip
.
framework
.
apollo
.
spring
.
config
;
import
com.ctrip.framework.apollo.Config
;
import
java.util.Set
;
import
org.springframework.core.env.EnumerablePropertySource
;
import
org.springframework.core.env.PropertySource
;
import
com.ctrip.framework.apollo.Config
;
/**
* Property source wrapper for Config
*
* @author Jason Song(song_s@ctrip.com)
*/
public
class
ConfigPropertySource
extends
PropertySource
<
Config
>
{
public
class
ConfigPropertySource
extends
EnumerablePropertySource
<
Config
>
{
private
static
final
String
[]
EMPTY_ARRAY
=
new
String
[
0
];
public
ConfigPropertySource
(
String
name
,
Config
source
)
{
super
(
name
,
source
);
}
@Override
public
String
[]
getPropertyNames
()
{
Set
<
String
>
propertyNames
=
this
.
source
.
getPropertyNames
();
if
(
propertyNames
.
isEmpty
())
{
return
EMPTY_ARRAY
;
}
return
propertyNames
.
toArray
(
new
String
[
propertyNames
.
size
()]);
}
@Override
public
Object
getProperty
(
String
name
)
{
return
this
.
source
.
getProperty
(
name
,
null
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment