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
5f66c098
Commit
5f66c098
authored
Jan 22, 2018
by
dreis2211
Committed by
Phillip Webb
Jan 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Narrow scope of some variables
Closes gh-11743
parent
8903f049
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
BeanTypeRegistry.java
...mework/boot/autoconfigure/condition/BeanTypeRegistry.java
+2
-2
OnClassCondition.java
...mework/boot/autoconfigure/condition/OnClassCondition.java
+2
-2
EntityScanner.java
...ingframework/boot/autoconfigure/domain/EntityScanner.java
+2
-2
ConditionEvaluationReportMessage.java
...toconfigure/logging/ConditionEvaluationReportMessage.java
+2
-2
ServletContextInitializerBeans.java
...work/boot/web/servlet/ServletContextInitializerBeans.java
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/BeanTypeRegistry.java
View file @
5f66c098
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -160,11 +160,11 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
...
@@ -160,11 +160,11 @@ final class BeanTypeRegistry implements SmartInitializingSingleton {
private
void
addBeanTypeForNonAliasDefinition
(
String
name
)
{
private
void
addBeanTypeForNonAliasDefinition
(
String
name
)
{
try
{
try
{
String
factoryName
=
BeanFactory
.
FACTORY_BEAN_PREFIX
+
name
;
RootBeanDefinition
beanDefinition
=
(
RootBeanDefinition
)
this
.
beanFactory
RootBeanDefinition
beanDefinition
=
(
RootBeanDefinition
)
this
.
beanFactory
.
getMergedBeanDefinition
(
name
);
.
getMergedBeanDefinition
(
name
);
if
(!
beanDefinition
.
isAbstract
()
if
(!
beanDefinition
.
isAbstract
()
&&
!
requiresEagerInit
(
beanDefinition
.
getFactoryBeanName
()))
{
&&
!
requiresEagerInit
(
beanDefinition
.
getFactoryBeanName
()))
{
String
factoryName
=
BeanFactory
.
FACTORY_BEAN_PREFIX
+
name
;
if
(
this
.
beanFactory
.
isFactoryBean
(
factoryName
))
{
if
(
this
.
beanFactory
.
isFactoryBean
(
factoryName
))
{
Class
<?>
factoryBeanGeneric
=
getFactoryBeanGeneric
(
this
.
beanFactory
,
Class
<?>
factoryBeanGeneric
=
getFactoryBeanGeneric
(
this
.
beanFactory
,
beanDefinition
,
name
);
beanDefinition
,
name
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnClassCondition.java
View file @
5f66c098
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -157,10 +157,10 @@ class OnClassCondition extends SpringBootCondition
...
@@ -157,10 +157,10 @@ class OnClassCondition extends SpringBootCondition
Class
<?>
annotationType
)
{
Class
<?>
annotationType
)
{
MultiValueMap
<
String
,
Object
>
attributes
=
metadata
MultiValueMap
<
String
,
Object
>
attributes
=
metadata
.
getAllAnnotationAttributes
(
annotationType
.
getName
(),
true
);
.
getAllAnnotationAttributes
(
annotationType
.
getName
(),
true
);
List
<
String
>
candidates
=
new
ArrayList
<>();
if
(
attributes
==
null
)
{
if
(
attributes
==
null
)
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
List
<
String
>
candidates
=
new
ArrayList
<>();
addAll
(
candidates
,
attributes
.
get
(
"value"
));
addAll
(
candidates
,
attributes
.
get
(
"value"
));
addAll
(
candidates
,
attributes
.
get
(
"name"
));
addAll
(
candidates
,
attributes
.
get
(
"name"
));
return
candidates
;
return
candidates
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/domain/EntityScanner.java
View file @
5f66c098
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -64,7 +64,6 @@ public class EntityScanner {
...
@@ -64,7 +64,6 @@ public class EntityScanner {
if
(
packages
.
isEmpty
())
{
if
(
packages
.
isEmpty
())
{
return
Collections
.
emptySet
();
return
Collections
.
emptySet
();
}
}
Set
<
Class
<?>>
entitySet
=
new
HashSet
<>();
ClassPathScanningCandidateComponentProvider
scanner
=
new
ClassPathScanningCandidateComponentProvider
(
ClassPathScanningCandidateComponentProvider
scanner
=
new
ClassPathScanningCandidateComponentProvider
(
false
);
false
);
scanner
.
setEnvironment
(
this
.
context
.
getEnvironment
());
scanner
.
setEnvironment
(
this
.
context
.
getEnvironment
());
...
@@ -72,6 +71,7 @@ public class EntityScanner {
...
@@ -72,6 +71,7 @@ public class EntityScanner {
for
(
Class
<?
extends
Annotation
>
annotationType
:
annotationTypes
)
{
for
(
Class
<?
extends
Annotation
>
annotationType
:
annotationTypes
)
{
scanner
.
addIncludeFilter
(
new
AnnotationTypeFilter
(
annotationType
));
scanner
.
addIncludeFilter
(
new
AnnotationTypeFilter
(
annotationType
));
}
}
Set
<
Class
<?>>
entitySet
=
new
HashSet
<>();
for
(
String
basePackage
:
packages
)
{
for
(
String
basePackage
:
packages
)
{
if
(
StringUtils
.
hasText
(
basePackage
))
{
if
(
StringUtils
.
hasText
(
basePackage
))
{
for
(
BeanDefinition
candidate
:
scanner
for
(
BeanDefinition
candidate
:
scanner
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportMessage.java
View file @
5f66c098
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -135,7 +135,6 @@ public class ConditionEvaluationReportMessage {
...
@@ -135,7 +135,6 @@ public class ConditionEvaluationReportMessage {
private
Map
<
String
,
ConditionAndOutcomes
>
orderByName
(
private
Map
<
String
,
ConditionAndOutcomes
>
orderByName
(
Map
<
String
,
ConditionAndOutcomes
>
outcomes
)
{
Map
<
String
,
ConditionAndOutcomes
>
outcomes
)
{
Map
<
String
,
ConditionAndOutcomes
>
result
=
new
LinkedHashMap
<>();
List
<
String
>
names
=
new
ArrayList
<>();
List
<
String
>
names
=
new
ArrayList
<>();
Map
<
String
,
String
>
classNames
=
new
HashMap
<>();
Map
<
String
,
String
>
classNames
=
new
HashMap
<>();
for
(
String
name
:
outcomes
.
keySet
())
{
for
(
String
name
:
outcomes
.
keySet
())
{
...
@@ -144,6 +143,7 @@ public class ConditionEvaluationReportMessage {
...
@@ -144,6 +143,7 @@ public class ConditionEvaluationReportMessage {
classNames
.
put
(
shortName
,
name
);
classNames
.
put
(
shortName
,
name
);
}
}
Collections
.
sort
(
names
);
Collections
.
sort
(
names
);
Map
<
String
,
ConditionAndOutcomes
>
result
=
new
LinkedHashMap
<>();
for
(
String
shortName
:
names
)
{
for
(
String
shortName
:
names
)
{
result
.
put
(
shortName
,
outcomes
.
get
(
classNames
.
get
(
shortName
)));
result
.
put
(
shortName
,
outcomes
.
get
(
classNames
.
get
(
shortName
)));
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
View file @
5f66c098
...
@@ -216,7 +216,6 @@ public class ServletContextInitializerBeans
...
@@ -216,7 +216,6 @@ public class ServletContextInitializerBeans
private
<
T
>
List
<
Entry
<
String
,
T
>>
getOrderedBeansOfType
(
private
<
T
>
List
<
Entry
<
String
,
T
>>
getOrderedBeansOfType
(
ListableBeanFactory
beanFactory
,
Class
<
T
>
type
,
Set
<?>
excludes
)
{
ListableBeanFactory
beanFactory
,
Class
<
T
>
type
,
Set
<?>
excludes
)
{
List
<
Entry
<
String
,
T
>>
beans
=
new
ArrayList
<>();
Comparator
<
Entry
<
String
,
T
>>
comparator
=
(
o1
,
Comparator
<
Entry
<
String
,
T
>>
comparator
=
(
o1
,
o2
)
->
AnnotationAwareOrderComparator
.
INSTANCE
.
compare
(
o1
.
getValue
(),
o2
)
->
AnnotationAwareOrderComparator
.
INSTANCE
.
compare
(
o1
.
getValue
(),
o2
.
getValue
());
o2
.
getValue
());
...
@@ -230,6 +229,7 @@ public class ServletContextInitializerBeans
...
@@ -230,6 +229,7 @@ public class ServletContextInitializerBeans
}
}
}
}
}
}
List
<
Entry
<
String
,
T
>>
beans
=
new
ArrayList
<>();
beans
.
addAll
(
map
.
entrySet
());
beans
.
addAll
(
map
.
entrySet
());
beans
.
sort
(
comparator
);
beans
.
sort
(
comparator
);
return
beans
;
return
beans
;
...
...
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