Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Spring_resource_analysis
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WeifengSun
Spring_resource_analysis
Commits
84f8a2e5
Commit
84f8a2e5
authored
Aug 03, 2022
by
SunWei峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8月3日
parent
9a4ff3c2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
spring-framework-main/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
+50
-0
spring-framework-main/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
+3
-0
No files found.
spring-framework-main/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
View file @
84f8a2e5
This diff is collapsed.
Click to expand it.
spring-framework-main/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
View file @
84f8a2e5
...
...
@@ -1174,7 +1174,9 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* @throws BeanDefinitionValidationException in case of validation failure
*/
protected
void
prepareMethodOverride
(
MethodOverride
mo
)
throws
BeanDefinitionValidationException
{
// 获取对应类中对应方法的个数
int
count
=
ClassUtils
.
getMethodCountForName
(
getBeanClass
(),
mo
.
getMethodName
());
// 等于0抛出异常。上面已经验证有方法需要覆盖,这里为0肯定错误
if
(
count
==
0
)
{
throw
new
BeanDefinitionValidationException
(
"Invalid method override: no method with name '"
+
mo
.
getMethodName
()
+
...
...
@@ -1182,6 +1184,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
else
if
(
count
==
1
)
{
// Mark override as not overloaded, to avoid the overhead of arg type checking.
// 标记MethodOverride暂未被覆盖,避免参数类型检查开销
mo
.
setOverloaded
(
false
);
}
}
...
...
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