Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
带水的鱼儿
spring-framework
提交
d469f621
S
spring-framework
项目概览
带水的鱼儿
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d469f621
编写于
6月 22, 2021
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
32147867
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
18 deletion
+18
-18
spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java
...va/org/springframework/context/annotation/BeanMethod.java
+4
-3
spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadata.java
...ramework/core/type/classreading/SimpleMethodMetadata.java
+3
-4
spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java
...type/classreading/SimpleMethodMetadataReadingVisitor.java
+11
-11
未找到文件。
spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java
浏览文件 @
d469f621
/*
* Copyright 2002-20
18
the original author or authors.
* Copyright 2002-20
21
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -21,8 +21,8 @@ import org.springframework.beans.factory.parsing.ProblemReporter;
import
org.springframework.core.type.MethodMetadata
;
/**
* Represents a {@link Configuration @Configuration} class method
marked with the
* {@link Bean @Bean}
annotation
.
* Represents a {@link Configuration @Configuration} class method
annotated with
* {@link Bean @Bean}.
*
* @author Chris Beams
* @author Juergen Hoeller
...
...
@@ -60,4 +60,5 @@ final class BeanMethod extends ConfigurationMethod {
getMetadata
().
getMethodName
()),
getResourceLocation
());
}
}
}
spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadata.java
浏览文件 @
d469f621
/*
* Copyright 2002-20
19
the original author or authors.
* Copyright 2002-20
21
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -21,8 +21,7 @@ import org.springframework.core.annotation.MergedAnnotations;
import
org.springframework.core.type.MethodMetadata
;
/**
* {@link MethodMetadata} created from a
* {@link SimpleMethodMetadataReadingVisitor}.
* {@link MethodMetadata} created from a {@link SimpleMethodMetadataReadingVisitor}.
*
* @author Phillip Webb
* @since 5.2
...
...
@@ -86,7 +85,7 @@ final class SimpleMethodMetadata implements MethodMetadata {
return
!
isStatic
()
&&
!
isFinal
()
&&
!
isPrivate
();
}
p
ublic
boolean
isPrivate
()
{
p
rivate
boolean
isPrivate
()
{
return
(
this
.
access
&
Opcodes
.
ACC_PRIVATE
)
!=
0
;
}
...
...
spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMethodMetadataReadingVisitor.java
浏览文件 @
d469f621
...
...
@@ -43,7 +43,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
private
final
int
access
;
private
final
String
n
ame
;
private
final
String
methodN
ame
;
private
final
String
descriptor
;
...
...
@@ -56,13 +56,13 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
SimpleMethodMetadataReadingVisitor
(
@Nullable
ClassLoader
classLoader
,
String
declaringClassName
,
int
access
,
String
n
ame
,
String
descriptor
,
Consumer
<
SimpleMethodMetadata
>
consumer
)
{
int
access
,
String
methodN
ame
,
String
descriptor
,
Consumer
<
SimpleMethodMetadata
>
consumer
)
{
super
(
SpringAsmInfo
.
ASM_VERSION
);
this
.
classLoader
=
classLoader
;
this
.
declaringClassName
=
declaringClassName
;
this
.
access
=
access
;
this
.
name
=
n
ame
;
this
.
methodName
=
methodN
ame
;
this
.
descriptor
=
descriptor
;
this
.
consumer
=
consumer
;
}
...
...
@@ -80,7 +80,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
if
(!
this
.
annotations
.
isEmpty
())
{
String
returnTypeName
=
Type
.
getReturnType
(
this
.
descriptor
).
getClassName
();
MergedAnnotations
annotations
=
MergedAnnotations
.
of
(
this
.
annotations
);
SimpleMethodMetadata
metadata
=
new
SimpleMethodMetadata
(
this
.
n
ame
,
SimpleMethodMetadata
metadata
=
new
SimpleMethodMetadata
(
this
.
methodN
ame
,
this
.
access
,
this
.
declaringClassName
,
returnTypeName
,
annotations
);
this
.
consumer
.
accept
(
metadata
);
}
...
...
@@ -89,7 +89,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
private
Object
getSource
()
{
Source
source
=
this
.
source
;
if
(
source
==
null
)
{
source
=
new
Source
(
this
.
declaringClassName
,
this
.
n
ame
,
this
.
descriptor
);
source
=
new
Source
(
this
.
declaringClassName
,
this
.
methodN
ame
,
this
.
descriptor
);
this
.
source
=
source
;
}
return
source
;
...
...
@@ -103,16 +103,16 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
private
final
String
declaringClassName
;
private
final
String
n
ame
;
private
final
String
methodN
ame
;
private
final
String
descriptor
;
@Nullable
private
String
toStringValue
;
Source
(
String
declaringClassName
,
String
n
ame
,
String
descriptor
)
{
Source
(
String
declaringClassName
,
String
methodN
ame
,
String
descriptor
)
{
this
.
declaringClassName
=
declaringClassName
;
this
.
name
=
n
ame
;
this
.
methodName
=
methodN
ame
;
this
.
descriptor
=
descriptor
;
}
...
...
@@ -120,7 +120,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
public
int
hashCode
()
{
int
result
=
1
;
result
=
31
*
result
+
this
.
declaringClassName
.
hashCode
();
result
=
31
*
result
+
this
.
n
ame
.
hashCode
();
result
=
31
*
result
+
this
.
methodN
ame
.
hashCode
();
result
=
31
*
result
+
this
.
descriptor
.
hashCode
();
return
result
;
}
...
...
@@ -135,7 +135,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
}
Source
otherSource
=
(
Source
)
other
;
return
(
this
.
declaringClassName
.
equals
(
otherSource
.
declaringClassName
)
&&
this
.
name
.
equals
(
otherSource
.
n
ame
)
&&
this
.
descriptor
.
equals
(
otherSource
.
descriptor
));
this
.
methodName
.
equals
(
otherSource
.
methodN
ame
)
&&
this
.
descriptor
.
equals
(
otherSource
.
descriptor
));
}
@Override
...
...
@@ -145,7 +145,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
this
.
declaringClassName
);
builder
.
append
(
"."
);
builder
.
append
(
this
.
n
ame
);
builder
.
append
(
this
.
methodN
ame
);
Type
[]
argumentTypes
=
Type
.
getArgumentTypes
(
this
.
descriptor
);
builder
.
append
(
"("
);
for
(
Type
type
:
argumentTypes
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录