Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
fe56aa6f
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 搜索 >>
提交
fe56aa6f
编写于
3月 13, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
88049e9b
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
382 addition
and
362 deletion
+382
-362
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
...springframework/cache/interceptor/CacheAspectSupport.java
+6
-6
spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSource.java
...ringframework/cache/interceptor/CacheOperationSource.java
+4
-3
spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java
...work/cache/interceptor/CompositeCacheOperationSource.java
+5
-4
spring-context/src/main/java/org/springframework/scripting/support/StandardScriptFactory.java
...ingframework/scripting/support/StandardScriptFactory.java
+3
-2
spring-core/src/main/java/org/springframework/lang/NonNull.java
...-core/src/main/java/org/springframework/lang/NonNull.java
+4
-3
spring-core/src/main/java/org/springframework/lang/NonNullFields.java
...src/main/java/org/springframework/lang/NonNullFields.java
+2
-2
spring-core/src/main/java/org/springframework/lang/Nullable.java
...core/src/main/java/org/springframework/lang/Nullable.java
+5
-3
spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
...c/main/java/org/springframework/util/ReflectionUtils.java
+339
-327
spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java
...tion/interceptor/CompositeTransactionAttributeSource.java
+6
-6
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSource.java
...k/transaction/interceptor/TransactionAttributeSource.java
+3
-3
spring-web/src/main/java/org/springframework/http/server/ServerHttpRequest.java
...va/org/springframework/http/server/ServerHttpRequest.java
+5
-3
未找到文件。
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
浏览文件 @
fe56aa6f
/*
* 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.
...
...
@@ -313,9 +313,9 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
* @param expectedType type for the bean
* @return the bean matching that name
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException if such bean does not exist
* @see CacheOperation#
keyGenerator
* @see CacheOperation#
cacheManager
* @see CacheOperation#
cacheResolver
* @see CacheOperation#
getKeyGenerator()
* @see CacheOperation#
getCacheManager()
* @see CacheOperation#
getCacheResolver()
*/
protected
<
T
>
T
getBean
(
String
beanName
,
Class
<
T
>
expectedType
)
{
if
(
this
.
beanFactory
==
null
)
{
...
...
@@ -353,8 +353,8 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
/**
* Execute the underlying operation (typically in case of cache miss) and return
* the result of the invocation. If an exception occurs it will be wrapped in
*
a
{@link CacheOperationInvoker.ThrowableWrapper}: the exception can be handled
* the result of the invocation. If an exception occurs it will be wrapped in
a
* {@link CacheOperationInvoker.ThrowableWrapper}: the exception can be handled
* or modified but it <em>must</em> be wrapped in a
* {@link CacheOperationInvoker.ThrowableWrapper} as well.
* @param invoker the invoker handling the operation being cached
...
...
spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSource.java
浏览文件 @
fe56aa6f
/*
* Copyright 2002-201
2
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.
...
...
@@ -27,13 +27,14 @@ import org.springframework.lang.Nullable;
* source level, or elsewhere.
*
* @author Costin Leau
* @author Juergen Hoeller
* @since 3.1
*/
public
interface
CacheOperationSource
{
/**
* Return the collection of cache operations for this method,
or {@code null}
* if the method contains no <em>cacheable</em> annotations.
* Return the collection of cache operations for this method,
*
or {@code null}
if the method contains no <em>cacheable</em> annotations.
* @param method the method to introspect
* @param targetClass the target class (may be {@code null}, in which case
* the declaring class of the method must be used)
...
...
spring-context/src/main/java/org/springframework/cache/interceptor/CompositeCacheOperationSource.java
浏览文件 @
fe56aa6f
/*
* Copyright 2002-201
6
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.
...
...
@@ -29,6 +29,7 @@ import org.springframework.util.Assert;
* over a given array of {@code CacheOperationSource} instances.
*
* @author Costin Leau
* @author Juergen Hoeller
* @since 3.1
*/
@SuppressWarnings
(
"serial"
)
...
...
@@ -42,7 +43,7 @@ public class CompositeCacheOperationSource implements CacheOperationSource, Seri
* @param cacheOperationSources the CacheOperationSource instances to combine
*/
public
CompositeCacheOperationSource
(
CacheOperationSource
...
cacheOperationSources
)
{
Assert
.
notEmpty
(
cacheOperationSources
,
"
cacheOperationSources
array must not be empty"
);
Assert
.
notEmpty
(
cacheOperationSources
,
"
CacheOperationSource
array must not be empty"
);
this
.
cacheOperationSources
=
cacheOperationSources
;
}
...
...
@@ -54,21 +55,21 @@ public class CompositeCacheOperationSource implements CacheOperationSource, Seri
return
this
.
cacheOperationSources
;
}
@Override
@Nullable
public
Collection
<
CacheOperation
>
getCacheOperations
(
Method
method
,
@Nullable
Class
<?>
targetClass
)
{
Collection
<
CacheOperation
>
ops
=
null
;
for
(
CacheOperationSource
source
:
this
.
cacheOperationSources
)
{
Collection
<
CacheOperation
>
cacheOperations
=
source
.
getCacheOperations
(
method
,
targetClass
);
if
(
cacheOperations
!=
null
)
{
if
(
ops
==
null
)
{
ops
=
new
ArrayList
<>();
}
ops
.
addAll
(
cacheOperations
);
}
}
return
ops
;
}
}
spring-context/src/main/java/org/springframework/scripting/support/StandardScriptFactory.java
浏览文件 @
fe56aa6f
/*
* 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.
...
...
@@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
/**
* {@link org.springframework.scripting.ScriptFactory} implementation based
* on the JSR-223 script engine abstraction (as included in Java 6+).
* Supports JavaScript, Groovy, JRuby and other JSR-223 compliant engines.
* Supports JavaScript, Groovy, JRuby
,
and other JSR-223 compliant engines.
*
* <p>Typically used in combination with a
* {@link org.springframework.scripting.support.ScriptFactoryPostProcessor};
...
...
@@ -151,6 +151,7 @@ public class StandardScriptFactory implements ScriptFactory, BeanClassLoaderAwar
if
(
script
instanceof
Class
?
!
requestedIfc
.
isAssignableFrom
((
Class
<?>)
script
)
:
!
requestedIfc
.
isInstance
(
script
))
{
adaptationRequired
=
true
;
break
;
}
}
if
(
adaptationRequired
)
{
...
...
spring-core/src/main/java/org/springframework/lang/NonNull.java
浏览文件 @
fe56aa6f
/*
* 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.
...
...
@@ -26,8 +26,9 @@ import javax.annotation.meta.TypeQualifierNickname;
/**
* A common Spring annotation to declare that annotated elements cannot be {@code null}.
* Leverages JSR 305 meta-annotations to indicate nullability in Java to common tools with
* JSR 305 support and used by Kotlin to infer nullability of Spring API.
*
* <p>Leverages JSR-305 meta-annotations to indicate nullability in Java to common
* tools with JSR-305 support and used by Kotlin to infer nullability of Spring API.
*
* <p>Should be used at parameter, return value, and field level. Method overrides should
* repeat parent {@code @NonNull} annotations unless they behave differently.
...
...
spring-core/src/main/java/org/springframework/lang/NonNullFields.java
浏览文件 @
fe56aa6f
/*
* 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.
...
...
@@ -36,7 +36,7 @@ import javax.annotation.meta.TypeQualifierDefault;
*
* @author Sebastien Deleuze
* @since 5.0
* @see NonNull
Fields
* @see NonNull
Api
* @see Nullable
* @see NonNull
*/
...
...
spring-core/src/main/java/org/springframework/lang/Nullable.java
浏览文件 @
fe56aa6f
/*
* 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.
...
...
@@ -27,8 +27,10 @@ import javax.annotation.meta.When;
/**
* A common Spring annotation to declare that annotated elements can be {@code null} under
* some circumstance. Leverages JSR 305 meta-annotations to indicate nullability in Java
* to common tools with JSR 305 support and used by Kotlin to infer nullability of Spring API.
* some circumstance.
*
* <p>Leverages JSR-305 meta-annotations to indicate nullability in Java to common
* tools with JSR-305 support and used by Kotlin to infer nullability of Spring API.
*
* <p>Should be used at parameter, return value, and field level. Methods override should
* repeat parent {@code @Nullable} annotations unless they behave differently.
...
...
spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
浏览文件 @
fe56aa6f
此差异已折叠。
点击以展开。
spring-tx/src/main/java/org/springframework/transaction/interceptor/CompositeTransactionAttributeSource.java
浏览文件 @
fe56aa6f
/*
* Copyright 2002-201
2
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.
...
...
@@ -39,7 +39,7 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
* Create a new CompositeTransactionAttributeSource for the given sources.
* @param transactionAttributeSources the TransactionAttributeSource instances to combine
*/
public
CompositeTransactionAttributeSource
(
TransactionAttributeSource
[]
transactionAttributeSources
)
{
public
CompositeTransactionAttributeSource
(
TransactionAttributeSource
...
transactionAttributeSources
)
{
Assert
.
notNull
(
transactionAttributeSources
,
"TransactionAttributeSource array must not be null"
);
this
.
transactionAttributeSources
=
transactionAttributeSources
;
}
...
...
@@ -56,10 +56,10 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
@Override
@Nullable
public
TransactionAttribute
getTransactionAttribute
(
Method
method
,
@Nullable
Class
<?>
targetClass
)
{
for
(
TransactionAttributeSource
tas
:
this
.
transactionAttributeSources
)
{
TransactionAttribute
ta
=
tas
.
getTransactionAttribute
(
method
,
targetClass
);
if
(
ta
!=
null
)
{
return
ta
;
for
(
TransactionAttributeSource
source
:
this
.
transactionAttributeSources
)
{
TransactionAttribute
attr
=
source
.
getTransactionAttribute
(
method
,
targetClass
);
if
(
attr
!=
null
)
{
return
attr
;
}
}
return
null
;
...
...
spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAttributeSource.java
浏览文件 @
fe56aa6f
/*
* 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.
...
...
@@ -27,6 +27,7 @@ import org.springframework.lang.Nullable;
* metadata attributes at source level (such as Java 5 annotations), or anywhere else.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @since 15.04.2003
* @see TransactionInterceptor#setTransactionAttributeSource
* @see TransactionProxyFactoryBean#setTransactionAttributeSource
...
...
@@ -40,8 +41,7 @@ public interface TransactionAttributeSource {
* @param method the method to introspect
* @param targetClass the target class (may be {@code null},
* in which case the declaring class of the method must be used)
* @return the TransactionAttribute the matching transaction attribute,
* or {@code null} if none found
* @return the matching transaction attribute, or {@code null} if none found
*/
@Nullable
TransactionAttribute
getTransactionAttribute
(
Method
method
,
@Nullable
Class
<?>
targetClass
);
...
...
spring-web/src/main/java/org/springframework/http/server/ServerHttpRequest.java
浏览文件 @
fe56aa6f
/*
* Copyright 2002-201
1
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.
...
...
@@ -21,6 +21,7 @@ import java.security.Principal;
import
org.springframework.http.HttpInputMessage
;
import
org.springframework.http.HttpRequest
;
import
org.springframework.lang.Nullable
;
/**
* Represents a server-side HTTP request.
...
...
@@ -33,9 +34,10 @@ public interface ServerHttpRequest extends HttpRequest, HttpInputMessage {
/**
* Return a {@link java.security.Principal} instance containing the name of the
* authenticated user.
If the user has not been authenticated, the method returns
* <code>null</code>.
* authenticated user.
* <
p>If the user has not been authenticated, the method returns <
code>null</code>.
*/
@Nullable
Principal
getPrincipal
();
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录