Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
bb6f9bb6
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,体验更适合开发者的 AI 搜索 >>
提交
bb6f9bb6
编写于
9月 25, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
0519a2ff
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
33 addition
and
35 deletion
+33
-35
spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
...java/org/springframework/aop/framework/CglibAopProxy.java
+6
-5
spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java
...ngframework/aop/framework/ReflectiveMethodInvocation.java
+3
-3
spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
...ringframework/aop/support/DefaultIntroductionAdvisor.java
+1
-1
spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java
.../springframework/aop/support/NameMatchMethodPointcut.java
+1
-0
spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java
.../main/java/org/springframework/aop/support/Pointcuts.java
+1
-0
spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
...tory/annotation/AutowiredAnnotationBeanPostProcessor.java
+8
-6
spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java
...actory/support/CglibSubclassingInstantiationStrategy.java
+1
-1
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
...ork/beans/factory/support/DefaultListableBeanFactory.java
+2
-1
spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java
.../src/main/java/org/springframework/asm/SpringAsmInfo.java
+2
-2
spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
.../org/springframework/util/ConcurrentReferenceHashMap.java
+3
-3
spring-test/src/main/java/org/springframework/test/web/reactive/server/ExchangeResult.java
...ingframework/test/web/reactive/server/ExchangeResult.java
+2
-6
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java
...amework/web/servlet/mvc/method/annotation/SseEmitter.java
+3
-7
未找到文件。
spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
浏览文件 @
bb6f9bb6
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -327,10 +327,11 @@ class CglibAopProxy implements AopProxy, Serializable {
// TODO: small memory optimization here (can skip creation for methods with no advice)
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
(
chain
,
this
.
advised
.
getTargetSource
().
getTarget
(),
this
.
advised
.
getTargetClass
());
this
.
fixedInterceptorMap
.
put
(
methods
[
x
]
.
toString
(),
x
);
this
.
fixedInterceptorMap
.
put
(
methods
.
toString
(),
x
);
}
// Now copy both the callbacks from mainCallbacks
...
...
@@ -633,8 +634,8 @@ class CglibAopProxy implements AopProxy, Serializable {
@Override
@Nullable
public
Object
intercept
(
Object
proxy
,
Method
method
,
Object
[]
args
,
MethodProxy
methodProxy
)
throws
Throwable
{
MethodInvocation
invocation
=
new
CglibMethodInvocation
(
proxy
,
this
.
target
,
method
,
args
,
this
.
targetClass
,
this
.
adviceChain
,
methodProxy
);
MethodInvocation
invocation
=
new
CglibMethodInvocation
(
proxy
,
this
.
target
,
method
,
args
,
this
.
targetClass
,
this
.
adviceChain
,
methodProxy
);
// If we get here, we need to create a MethodInvocation.
Object
retVal
=
invocation
.
proceed
();
retVal
=
processReturnType
(
proxy
,
this
.
target
,
method
,
retVal
);
...
...
spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java
浏览文件 @
bb6f9bb6
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -68,7 +68,7 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
protected
final
Method
method
;
protected
Object
[]
arguments
=
new
Object
[
0
]
;
protected
Object
[]
arguments
;
@Nullable
private
final
Class
<?>
targetClass
;
...
...
@@ -158,7 +158,7 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
@Override
@Nullable
public
Object
proceed
()
throws
Throwable
{
//
We start with an index of -1 and increment early.
//
We start with an index of -1 and increment early.
if
(
this
.
currentInterceptorIndex
==
this
.
interceptorsAndDynamicMethodMatchers
.
size
()
-
1
)
{
return
invokeJoinpoint
();
}
...
...
spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java
浏览文件 @
bb6f9bb6
...
...
@@ -39,7 +39,7 @@ import org.springframework.util.ClassUtils;
* @author Juergen Hoeller
* @since 11.11.2003
*/
@SuppressWarnings
(
{
"serial"
}
)
@SuppressWarnings
(
"serial"
)
public
class
DefaultIntroductionAdvisor
implements
IntroductionAdvisor
,
ClassFilter
,
Ordered
,
Serializable
{
private
final
Advice
advice
;
...
...
spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java
浏览文件 @
bb6f9bb6
...
...
@@ -26,6 +26,7 @@ import org.springframework.util.PatternMatchUtils;
/**
* Pointcut bean for simple method name matches, as an alternative to regexp patterns.
*
* <p>Does not handle overloaded methods: all methods with a given name will be eligible.
*
* @author Juergen Hoeller
...
...
spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java
浏览文件 @
bb6f9bb6
...
...
@@ -26,6 +26,7 @@ import org.springframework.util.Assert;
/**
* Pointcut constants for matching getters and setters,
* and static methods useful for manipulating and evaluating pointcuts.
*
* <p>These methods are particularly useful for composing pointcuts
* using the union and intersection methods.
*
...
...
spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java
浏览文件 @
bb6f9bb6
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -139,9 +139,10 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
/**
* Create a new AutowiredAnnotationBeanPostProcessor
* for Spring's standard {@link Autowired} annotation.
* <p>Also supports JSR-330's {@link javax.inject.Inject} annotation, if available.
* Create a new {@code AutowiredAnnotationBeanPostProcessor} for Spring's
* standard {@link Autowired @Autowired} annotation.
* <p>Also supports JSR-330's {@link javax.inject.Inject @Inject} annotation,
* if available.
*/
@SuppressWarnings
(
"unchecked"
)
public
AutowiredAnnotationBeanPostProcessor
()
{
...
...
@@ -242,7 +243,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
public
Constructor
<?>[]
determineCandidateConstructors
(
Class
<?>
beanClass
,
final
String
beanName
)
throws
BeanCreationException
{
// Let's check for lookup methods here..
// Let's check for lookup methods here..
.
if
(!
this
.
lookupMethodsChecked
.
contains
(
beanName
))
{
try
{
ReflectionUtils
.
doWithMethods
(
beanClass
,
method
->
{
...
...
@@ -251,7 +252,8 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
Assert
.
state
(
this
.
beanFactory
!=
null
,
"No BeanFactory available"
);
LookupOverride
override
=
new
LookupOverride
(
method
,
lookup
.
value
());
try
{
RootBeanDefinition
mbd
=
(
RootBeanDefinition
)
this
.
beanFactory
.
getMergedBeanDefinition
(
beanName
);
RootBeanDefinition
mbd
=
(
RootBeanDefinition
)
this
.
beanFactory
.
getMergedBeanDefinition
(
beanName
);
mbd
.
getMethodOverrides
().
addOverride
(
override
);
}
catch
(
NoSuchBeanDefinitionException
ex
)
{
...
...
spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java
浏览文件 @
bb6f9bb6
...
...
@@ -249,7 +249,7 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
public
int
accept
(
Method
method
)
{
MethodOverride
methodOverride
=
getBeanDefinition
().
getMethodOverrides
().
getOverride
(
method
);
if
(
logger
.
isTraceEnabled
())
{
logger
.
trace
(
"
Override for '"
+
method
.
getName
()
+
"' is ["
+
methodOverride
+
"]"
);
logger
.
trace
(
"
MethodOverride for "
+
method
+
": "
+
methodOverride
);
}
if
(
methodOverride
==
null
)
{
return
PASSTHROUGH
;
...
...
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
浏览文件 @
bb6f9bb6
...
...
@@ -322,7 +322,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
this
.
allowEagerClassLoading
=
otherListableFactory
.
allowEagerClassLoading
;
this
.
dependencyComparator
=
otherListableFactory
.
dependencyComparator
;
// A clone of the AutowireCandidateResolver since it is potentially BeanFactoryAware...
setAutowireCandidateResolver
(
BeanUtils
.
instantiateClass
(
otherListableFactory
.
getAutowireCandidateResolver
().
getClass
()));
setAutowireCandidateResolver
(
BeanUtils
.
instantiateClass
(
otherListableFactory
.
getAutowireCandidateResolver
().
getClass
()));
// Make resolvable dependencies (e.g. ResourceLoader) available here as well...
this
.
resolvableDependencies
.
putAll
(
otherListableFactory
.
resolvableDependencies
);
}
...
...
spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java
浏览文件 @
bb6f9bb6
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -18,7 +18,7 @@ package org.springframework.asm;
/**
* Utility class exposing constants related to Spring's internal repackaging
* of the ASM bytecode library: currently based on ASM 7.
0
plus minor patches.
* of the ASM bytecode library: currently based on ASM 7.
x
plus minor patches.
*
* <p>See <a href="package-summary.html">package-level javadocs</a> for more
* information on {@code org.springframework.asm}.
...
...
spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
浏览文件 @
bb6f9bb6
...
...
@@ -829,7 +829,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
/**
* Allows a task access to {@link Segment} entries.
* Allows a task access to {@link
ConcurrentReferenceHashMap.
Segment} entries.
*/
private
abstract
class
Entries
{
...
...
@@ -980,8 +980,8 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
/**
* Strategy class used to manage {@link Reference References}.
This class can be overridden if
* alternative reference types need to be supported.
* Strategy class used to manage {@link Reference References}.
*
This class can be overridden if
alternative reference types need to be supported.
*/
protected
class
ReferenceManager
{
...
...
spring-test/src/main/java/org/springframework/test/web/reactive/server/ExchangeResult.java
浏览文件 @
bb6f9bb6
...
...
@@ -155,7 +155,7 @@ public class ExchangeResult {
/**
* Return the
status of the executed request
.
* Return the
HTTP status code as an {@link HttpStatus} enum value
.
*/
public
HttpStatus
getStatus
()
{
return
this
.
response
.
getStatusCode
();
...
...
@@ -219,16 +219,12 @@ public class ExchangeResult {
"\n"
+
formatBody
(
getRequestHeaders
().
getContentType
(),
this
.
requestBody
)
+
"\n"
+
"\n"
+
"< "
+
getStatus
()
+
" "
+
getStatus
Reason
()
+
"\n"
+
"< "
+
getStatus
()
+
" "
+
getStatus
().
getReasonPhrase
()
+
"\n"
+
"< "
+
formatHeaders
(
getResponseHeaders
(),
"\n< "
)
+
"\n"
+
"\n"
+
formatBody
(
getResponseHeaders
().
getContentType
(),
this
.
responseBody
)
+
"\n"
;
}
private
String
getStatusReason
()
{
return
getStatus
().
getReasonPhrase
();
}
private
String
formatHeaders
(
HttpHeaders
headers
,
String
delimiter
)
{
return
headers
.
entrySet
().
stream
()
.
map
(
entry
->
entry
.
getKey
()
+
": "
+
entry
.
getValue
())
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java
浏览文件 @
bb6f9bb6
/*
* Copyright 2002-201
7
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -41,7 +41,7 @@ public class SseEmitter extends ResponseBodyEmitter {
static
final
MediaType
TEXT_PLAIN
=
new
MediaType
(
"text"
,
"plain"
,
StandardCharsets
.
UTF_8
);
static
final
MediaType
UTF8_
TEXT_EVENTSTREAM
=
new
MediaType
(
"text"
,
"event-stream"
,
StandardCharsets
.
UTF_8
);
static
final
MediaType
TEXT_EVENTSTREAM
=
new
MediaType
(
"text"
,
"event-stream"
,
StandardCharsets
.
UTF_8
);
/**
...
...
@@ -70,7 +70,7 @@ public class SseEmitter extends ResponseBodyEmitter {
HttpHeaders
headers
=
outputMessage
.
getHeaders
();
if
(
headers
.
getContentType
()
==
null
)
{
headers
.
setContentType
(
UTF8_
TEXT_EVENTSTREAM
);
headers
.
setContentType
(
TEXT_EVENTSTREAM
);
}
}
...
...
@@ -82,10 +82,8 @@ public class SseEmitter extends ResponseBodyEmitter {
* SseEmitter emitter = new SseEmitter();
* emitter.send(event().data(myObject));
* </pre>
*
* <p>Please, see {@link ResponseBodyEmitter#send(Object) parent Javadoc}
* for important notes on exception handling.
*
* @param object the object to write
* @throws IOException raised when an I/O error occurs
* @throws java.lang.IllegalStateException wraps any other errors
...
...
@@ -103,10 +101,8 @@ public class SseEmitter extends ResponseBodyEmitter {
* SseEmitter emitter = new SseEmitter();
* emitter.send(event().data(myObject, MediaType.APPLICATION_JSON));
* </pre>
*
* <p>Please, see {@link ResponseBodyEmitter#send(Object) parent Javadoc}
* for important notes on exception handling.
*
* @param object the object to write
* @param mediaType a MediaType hint for selecting an HttpMessageConverter
* @throws IOException raised when an I/O error occurs
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录