Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
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
spring-cloud-netflix
Commits
85ef54a9
Commit
85ef54a9
authored
Jul 21, 2016
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Feign validation for Spring 4.2 and 4.3
There is a utility method in Spring that we can use to merge all the aliases. That way 4.2 and 4.3 behave the same way. Fixes gh-1192
parent
2f581a11
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
FeignClientsRegistrar.java
...gframework/cloud/netflix/feign/FeignClientsRegistrar.java
+3
-4
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientsRegistrar.java
View file @
85ef54a9
...
@@ -40,6 +40,7 @@ import org.springframework.context.ConfigurableApplicationContext;
...
@@ -40,6 +40,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import
org.springframework.context.ResourceLoaderAware
;
import
org.springframework.context.ResourceLoaderAware
;
import
org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
;
import
org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider
;
import
org.springframework.context.annotation.ImportBeanDefinitionRegistrar
;
import
org.springframework.context.annotation.ImportBeanDefinitionRegistrar
;
import
org.springframework.core.annotation.AnnotationAttributes
;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.core.io.ResourceLoader
;
import
org.springframework.core.type.AnnotationMetadata
;
import
org.springframework.core.type.AnnotationMetadata
;
import
org.springframework.core.type.ClassMetadata
;
import
org.springframework.core.type.ClassMetadata
;
...
@@ -154,6 +155,8 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
...
@@ -154,6 +155,8 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
Map
<
String
,
Object
>
attributes
=
annotationMetadata
Map
<
String
,
Object
>
attributes
=
annotationMetadata
.
getAnnotationAttributes
(
.
getAnnotationAttributes
(
FeignClient
.
class
.
getCanonicalName
());
FeignClient
.
class
.
getCanonicalName
());
// Spring 4.2 didn't do this for us. With 4.3 it's idempotent.
attributes
=
AnnotationAttributes
.
fromMap
(
attributes
);
String
name
=
getClientName
(
attributes
);
String
name
=
getClientName
(
attributes
);
registerClientConfiguration
(
registry
,
name
,
registerClientConfiguration
(
registry
,
name
,
...
@@ -193,10 +196,6 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
...
@@ -193,10 +196,6 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
Assert
.
isTrue
(!
StringUtils
.
hasText
((
String
)
attributes
.
get
(
"serviceId"
)),
Assert
.
isTrue
(!
StringUtils
.
hasText
((
String
)
attributes
.
get
(
"serviceId"
)),
"Either name (serviceId) or value can be specified, but not both"
);
"Either name (serviceId) or value can be specified, but not both"
);
}
}
if
(
StringUtils
.
hasText
((
String
)
attributes
.
get
(
"name"
)))
{
Assert
.
isTrue
(!
StringUtils
.
hasText
((
String
)
attributes
.
get
(
"serviceId"
)),
"Either name or serviceId can be specified, but not both"
);
}
}
}
private
String
getName
(
Map
<
String
,
Object
>
attributes
)
{
private
String
getName
(
Map
<
String
,
Object
>
attributes
)
{
...
...
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