Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
e44d3dab
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
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,发现更多精彩内容 >>
提交
e44d3dab
编写于
1月 15, 2019
作者:
S
stsypanov
提交者:
Juergen Hoeller
2月 15, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use Method in fixedInterceptorMap instead of String returned from Method::toString
上级
e7dc439f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
7 addition
and
7 deletion
+7
-7
spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
...java/org/springframework/aop/framework/CglibAopProxy.java
+7
-6
spring-aop/src/main/java/org/springframework/aop/framework/ObjenesisCglibAopProxy.java
...springframework/aop/framework/ObjenesisCglibAopProxy.java
+0
-1
未找到文件。
spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
浏览文件 @
e44d3dab
...
@@ -112,7 +112,7 @@ class CglibAopProxy implements AopProxy, Serializable {
...
@@ -112,7 +112,7 @@ class CglibAopProxy implements AopProxy, Serializable {
/** Dispatcher used for methods on Advised. */
/** Dispatcher used for methods on Advised. */
private
final
transient
AdvisedDispatcher
advisedDispatcher
;
private
final
transient
AdvisedDispatcher
advisedDispatcher
;
private
transient
Map
<
String
,
Integer
>
fixedInterceptorMap
=
Collections
.
emptyMap
();
private
transient
Map
<
Method
,
Integer
>
fixedInterceptorMap
=
Collections
.
emptyMap
();
private
transient
int
fixedInterceptorOffset
;
private
transient
int
fixedInterceptorOffset
;
...
@@ -327,10 +327,11 @@ class CglibAopProxy implements AopProxy, Serializable {
...
@@ -327,10 +327,11 @@ class CglibAopProxy implements AopProxy, Serializable {
// TODO: small memory optimization here (can skip creation for methods with no advice)
// TODO: small memory optimization here (can skip creation for methods with no advice)
for
(
int
x
=
0
;
x
<
methods
.
length
;
x
++)
{
for
(
int
x
=
0
;
x
<
methods
.
length
;
x
++)
{
List
<
Object
>
chain
=
this
.
advised
.
getInterceptorsAndDynamicInterceptionAdvice
(
methods
[
x
],
rootClass
);
Method
method
=
methods
[
x
];
List
<
Object
>
chain
=
this
.
advised
.
getInterceptorsAndDynamicInterceptionAdvice
(
method
,
rootClass
);
fixedCallbacks
[
x
]
=
new
FixedChainStaticTargetInterceptor
(
fixedCallbacks
[
x
]
=
new
FixedChainStaticTargetInterceptor
(
chain
,
this
.
advised
.
getTargetSource
().
getTarget
(),
this
.
advised
.
getTargetClass
());
chain
,
this
.
advised
.
getTargetSource
().
getTarget
(),
this
.
advised
.
getTargetClass
());
this
.
fixedInterceptorMap
.
put
(
method
s
[
x
].
toString
()
,
x
);
this
.
fixedInterceptorMap
.
put
(
method
,
x
);
}
}
// Now copy both the callbacks from mainCallbacks
// Now copy both the callbacks from mainCallbacks
...
@@ -762,12 +763,12 @@ class CglibAopProxy implements AopProxy, Serializable {
...
@@ -762,12 +763,12 @@ class CglibAopProxy implements AopProxy, Serializable {
private
final
AdvisedSupport
advised
;
private
final
AdvisedSupport
advised
;
private
final
Map
<
String
,
Integer
>
fixedInterceptorMap
;
private
final
Map
<
Method
,
Integer
>
fixedInterceptorMap
;
private
final
int
fixedInterceptorOffset
;
private
final
int
fixedInterceptorOffset
;
public
ProxyCallbackFilter
(
public
ProxyCallbackFilter
(
AdvisedSupport
advised
,
Map
<
String
,
Integer
>
fixedInterceptorMap
,
int
fixedInterceptorOffset
)
{
AdvisedSupport
advised
,
Map
<
Method
,
Integer
>
fixedInterceptorMap
,
int
fixedInterceptorOffset
)
{
this
.
advised
=
advised
;
this
.
advised
=
advised
;
this
.
fixedInterceptorMap
=
fixedInterceptorMap
;
this
.
fixedInterceptorMap
=
fixedInterceptorMap
;
...
@@ -852,7 +853,7 @@ class CglibAopProxy implements AopProxy, Serializable {
...
@@ -852,7 +853,7 @@ class CglibAopProxy implements AopProxy, Serializable {
}
}
return
AOP_PROXY
;
return
AOP_PROXY
;
}
}
String
key
=
method
.
toString
()
;
Method
key
=
method
;
// Check to see if we have fixed interceptor to serve this method.
// Check to see if we have fixed interceptor to serve this method.
// Else use the AOP_PROXY.
// Else use the AOP_PROXY.
if
(
isStatic
&&
isFrozen
&&
this
.
fixedInterceptorMap
.
containsKey
(
key
))
{
if
(
isStatic
&&
isFrozen
&&
this
.
fixedInterceptorMap
.
containsKey
(
key
))
{
...
...
spring-aop/src/main/java/org/springframework/aop/framework/ObjenesisCglibAopProxy.java
浏览文件 @
e44d3dab
...
@@ -53,7 +53,6 @@ class ObjenesisCglibAopProxy extends CglibAopProxy {
...
@@ -53,7 +53,6 @@ class ObjenesisCglibAopProxy extends CglibAopProxy {
@Override
@Override
@SuppressWarnings
(
"unchecked"
)
protected
Object
createProxyClassAndInstance
(
Enhancer
enhancer
,
Callback
[]
callbacks
)
{
protected
Object
createProxyClassAndInstance
(
Enhancer
enhancer
,
Callback
[]
callbacks
)
{
Class
<?>
proxyClass
=
enhancer
.
createClass
();
Class
<?>
proxyClass
=
enhancer
.
createClass
();
Object
proxyInstance
=
null
;
Object
proxyInstance
=
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录