Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
0fd4e40e
Commit
0fd4e40e
authored
Jul 19, 2018
by
Johnny Lim
Committed by
Andy Wilkinson
Jul 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add null guards for getBeanDefinition() in BeanTypeRegistry
Closes gh-13818
parent
9c5330f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
BeanTypeRegistry.java
...mework/boot/autoconfigure/condition/BeanTypeRegistry.java
+11
-6
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java
View file @
0fd4e40e
...
@@ -159,7 +159,10 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
...
@@ -159,7 +159,10 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
}
}
private
void
addBeanTypeForNonAliasDefinition
(
String
name
)
{
private
void
addBeanTypeForNonAliasDefinition
(
String
name
)
{
addBeanTypeForNonAliasDefinition
(
name
,
getBeanDefinition
(
name
));
RootBeanDefinition
beanDefinition
=
getBeanDefinition
(
name
);
if
(
beanDefinition
!=
null
)
{
addBeanTypeForNonAliasDefinition
(
name
,
beanDefinition
);
}
}
}
private
RootBeanDefinition
getBeanDefinition
(
String
name
)
{
private
RootBeanDefinition
getBeanDefinition
(
String
name
)
{
...
@@ -219,11 +222,13 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
...
@@ -219,11 +222,13 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
if
(!
this
.
beanFactory
.
isAlias
(
name
)
if
(!
this
.
beanFactory
.
isAlias
(
name
)
&&
!
this
.
beanFactory
.
containsSingleton
(
name
))
{
&&
!
this
.
beanFactory
.
containsSingleton
(
name
))
{
RootBeanDefinition
beanDefinition
=
getBeanDefinition
(
name
);
RootBeanDefinition
beanDefinition
=
getBeanDefinition
(
name
);
RootBeanDefinition
existingDefinition
=
this
.
beanDefinitions
.
put
(
name
,
if
(
beanDefinition
!=
null
)
{
beanDefinition
);
RootBeanDefinition
existingDefinition
=
this
.
beanDefinitions
if
(
existingDefinition
!=
null
.
put
(
name
,
beanDefinition
);
&&
!
beanDefinition
.
equals
(
existingDefinition
))
{
if
(
existingDefinition
!=
null
addBeanTypeForNonAliasDefinition
(
name
,
beanDefinition
);
&&
!
beanDefinition
.
equals
(
existingDefinition
))
{
addBeanTypeForNonAliasDefinition
(
name
,
beanDefinition
);
}
}
}
}
}
}
}
...
...
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