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
434fb6e9
Commit
434fb6e9
authored
Dec 20, 2017
by
saga
Committed by
Ryan Baxter
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor the getScanner method of the FeignClientsRegistrar class (#2559)
parent
90094b6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
25 deletions
+6
-25
FeignClientsRegistrar.java
...gframework/cloud/netflix/feign/FeignClientsRegistrar.java
+6
-25
No files found.
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientsRegistrar.java
View file @
434fb6e9
...
@@ -59,6 +59,7 @@ import org.springframework.util.StringUtils;
...
@@ -59,6 +59,7 @@ import org.springframework.util.StringUtils;
* @author Spencer Gibb
* @author Spencer Gibb
* @author Jakub Narloch
* @author Jakub Narloch
* @author Venil Noronha
* @author Venil Noronha
* @author Gang Li
*/
*/
class
FeignClientsRegistrar
implements
ImportBeanDefinitionRegistrar
,
class
FeignClientsRegistrar
implements
ImportBeanDefinitionRegistrar
,
ResourceLoaderAware
,
BeanClassLoaderAware
,
EnvironmentAware
{
ResourceLoaderAware
,
BeanClassLoaderAware
,
EnvironmentAware
{
...
@@ -278,35 +279,15 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
...
@@ -278,35 +279,15 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
protected
ClassPathScanningCandidateComponentProvider
getScanner
()
{
protected
ClassPathScanningCandidateComponentProvider
getScanner
()
{
return
new
ClassPathScanningCandidateComponentProvider
(
false
,
this
.
environment
)
{
return
new
ClassPathScanningCandidateComponentProvider
(
false
,
this
.
environment
)
{
@Override
@Override
protected
boolean
isCandidateComponent
(
protected
boolean
isCandidateComponent
(
AnnotatedBeanDefinition
beanDefinition
)
{
AnnotatedBeanDefinition
beanDefinition
)
{
boolean
isCandidate
=
false
;
if
(
beanDefinition
.
getMetadata
().
isIndependent
())
{
if
(
beanDefinition
.
getMetadata
().
isIndependent
())
{
// TODO until SPR-11711 will be resolved
if
(!
beanDefinition
.
getMetadata
().
isAnnotation
())
{
if
(
beanDefinition
.
getMetadata
().
isInterface
()
isCandidate
=
true
;
&&
beanDefinition
.
getMetadata
()
.
getInterfaceNames
().
length
==
1
&&
Annotation
.
class
.
getName
().
equals
(
beanDefinition
.
getMetadata
().
getInterfaceNames
()[
0
]))
{
try
{
Class
<?>
target
=
ClassUtils
.
forName
(
beanDefinition
.
getMetadata
().
getClassName
(),
FeignClientsRegistrar
.
this
.
classLoader
);
return
!
target
.
isAnnotation
();
}
catch
(
Exception
ex
)
{
this
.
logger
.
error
(
"Could not load target class: "
+
beanDefinition
.
getMetadata
().
getClassName
(),
ex
);
}
}
}
return
true
;
}
}
return
false
;
return
isCandidate
;
}
}
};
};
}
}
...
...
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