Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sesemomo
spring-framework
提交
171e8f56
S
spring-framework
项目概览
sesemomo
/
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,发现更多精彩内容 >>
提交
171e8f56
编写于
5月 20, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '5.1.x'
上级
6f07a504
75d751d9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
25 deletion
+41
-25
spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java
...org/springframework/aop/framework/JdkDynamicAopProxy.java
+3
-2
spring-core/src/test/java/org/springframework/core/io/ResourceEditorTests.java
...java/org/springframework/core/io/ResourceEditorTests.java
+19
-5
spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java
...ork/core/io/support/ResourceArrayPropertyEditorTests.java
+5
-5
spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java
...ngframework/web/context/request/async/DeferredResult.java
+13
-12
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java
...work/web/socket/sockjs/support/AbstractSockJsService.java
+1
-1
未找到文件。
spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java
浏览文件 @
171e8f56
/*
* 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.
...
...
@@ -206,7 +206,8 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
}
else
{
// We need to create a method invocation...
MethodInvocation
invocation
=
new
ReflectiveMethodInvocation
(
proxy
,
target
,
method
,
args
,
targetClass
,
chain
);
MethodInvocation
invocation
=
new
ReflectiveMethodInvocation
(
proxy
,
target
,
method
,
args
,
targetClass
,
chain
);
// Proceed to the joinpoint through the interceptor chain.
retVal
=
invocation
.
proceed
();
}
...
...
spring-core/src/test/java/org/springframework/core/io/ResourceEditorTests.java
浏览文件 @
171e8f56
...
...
@@ -37,7 +37,7 @@ import static org.junit.Assert.assertTrue;
public
class
ResourceEditorTests
{
@Test
public
void
sunnyDay
()
throws
Exception
{
public
void
sunnyDay
()
{
PropertyEditor
editor
=
new
ResourceEditor
();
editor
.
setAsText
(
"classpath:org/springframework/core/io/ResourceEditorTests.class"
);
Resource
resource
=
(
Resource
)
editor
.
getValue
();
...
...
@@ -46,20 +46,20 @@ public class ResourceEditorTests {
}
@Test
public
void
ctorWithNullCtorArgs
()
throws
Exception
{
public
void
ctorWithNullCtorArgs
()
{
assertThatIllegalArgumentException
().
isThrownBy
(()
->
new
ResourceEditor
(
null
,
null
));
}
@Test
public
void
setAndGetAsTextWithNull
()
throws
Exception
{
public
void
setAndGetAsTextWithNull
()
{
PropertyEditor
editor
=
new
ResourceEditor
();
editor
.
setAsText
(
null
);
assertEquals
(
""
,
editor
.
getAsText
());
}
@Test
public
void
setAndGetAsTextWithWhitespaceResource
()
throws
Exception
{
public
void
setAndGetAsTextWithWhitespaceResource
()
{
PropertyEditor
editor
=
new
ResourceEditor
();
editor
.
setAsText
(
" "
);
assertEquals
(
""
,
editor
.
getAsText
());
...
...
@@ -67,6 +67,20 @@ public class ResourceEditorTests {
@Test
public
void
testSystemPropertyReplacement
()
{
PropertyEditor
editor
=
new
ResourceEditor
();
System
.
setProperty
(
"test.prop"
,
"foo"
);
try
{
editor
.
setAsText
(
"${test.prop}"
);
Resource
resolved
=
(
Resource
)
editor
.
getValue
();
assertEquals
(
"foo"
,
resolved
.
getFilename
());
}
finally
{
System
.
getProperties
().
remove
(
"test.prop"
);
}
}
@Test
public
void
testSystemPropertyReplacementWithUnresolvablePlaceholder
()
{
PropertyEditor
editor
=
new
ResourceEditor
();
System
.
setProperty
(
"test.prop"
,
"foo"
);
try
{
...
...
@@ -80,7 +94,7 @@ public class ResourceEditorTests {
}
@Test
public
void
testStrictSystemPropertyReplacement
()
{
public
void
testStrictSystemPropertyReplacement
WithUnresolvablePlaceholder
()
{
PropertyEditor
editor
=
new
ResourceEditor
(
new
DefaultResourceLoader
(),
new
StandardEnvironment
(),
false
);
System
.
setProperty
(
"test.prop"
,
"foo"
);
try
{
...
...
spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java
浏览文件 @
171e8f56
...
...
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertTrue;
public
class
ResourceArrayPropertyEditorTests
{
@Test
public
void
testVanillaResource
()
throws
Exception
{
public
void
testVanillaResource
()
{
PropertyEditor
editor
=
new
ResourceArrayPropertyEditor
();
editor
.
setAsText
(
"classpath:org/springframework/core/io/support/ResourceArrayPropertyEditor.class"
);
Resource
[]
resources
=
(
Resource
[])
editor
.
getValue
();
...
...
@@ -44,7 +44,7 @@ public class ResourceArrayPropertyEditorTests {
}
@Test
public
void
testPatternResource
()
throws
Exception
{
public
void
testPatternResource
()
{
// N.B. this will sometimes fail if you use classpath: instead of classpath*:.
// The result depends on the classpath - if test-classes are segregated from classes
// and they come first on the classpath (like in Maven) then it breaks, if classes
...
...
@@ -61,9 +61,9 @@ public class ResourceArrayPropertyEditorTests {
PropertyEditor
editor
=
new
ResourceArrayPropertyEditor
();
System
.
setProperty
(
"test.prop"
,
"foo"
);
try
{
editor
.
setAsText
(
"${test.prop}
-${bar}
"
);
editor
.
setAsText
(
"${test.prop}"
);
Resource
[]
resources
=
(
Resource
[])
editor
.
getValue
();
assertEquals
(
"foo
-${bar}
"
,
resources
[
0
].
getFilename
());
assertEquals
(
"foo"
,
resources
[
0
].
getFilename
());
}
finally
{
System
.
getProperties
().
remove
(
"test.prop"
);
...
...
@@ -71,7 +71,7 @@ public class ResourceArrayPropertyEditorTests {
}
@Test
public
void
testStrictSystemPropertyReplacement
()
{
public
void
testStrictSystemPropertyReplacement
WithUnresolvablePlaceholder
()
{
PropertyEditor
editor
=
new
ResourceArrayPropertyEditor
(
new
PathMatchingResourcePatternResolver
(),
new
StandardEnvironment
(),
false
);
...
...
spring-web/src/main/java/org/springframework/web/context/request/async/DeferredResult.java
浏览文件 @
171e8f56
/*
* 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.
...
...
@@ -59,7 +59,7 @@ public class DeferredResult<T> {
@Nullable
private
final
Long
timeout
;
private
final
Long
timeout
Value
;
private
final
Supplier
<?>
timeoutResult
;
...
...
@@ -88,35 +88,36 @@ public class DeferredResult<T> {
* <p>By default not set in which case the default configured in the MVC
* Java Config or the MVC namespace is used, or if that's not set, then the
* timeout depends on the default of the underlying server.
* @param timeout timeout value in milliseconds
* @param timeout
Value
timeout value in milliseconds
*/
public
DeferredResult
(
Long
timeout
)
{
this
(
timeout
,
()
->
RESULT_NONE
);
public
DeferredResult
(
Long
timeout
Value
)
{
this
(
timeout
Value
,
()
->
RESULT_NONE
);
}
/**
* Create a DeferredResult with a timeout value and a default result to use
* in case of timeout.
* @param timeout timeout value in milliseconds (ignored if {@code null})
* @param timeout
Value
timeout value in milliseconds (ignored if {@code null})
* @param timeoutResult the result to use
*/
public
DeferredResult
(
@Nullable
Long
timeout
,
final
Object
timeoutResult
)
{
public
DeferredResult
(
@Nullable
Long
timeout
Value
,
final
Object
timeoutResult
)
{
this
.
timeoutResult
=
()
->
timeoutResult
;
this
.
timeout
=
timeout
;
this
.
timeout
Value
=
timeoutValue
;
}
/**
* Variant of {@link #DeferredResult(Long, Object)} that accepts a dynamic
* fallback value based on a {@link Supplier}.
* @param timeout timeout value in milliseconds (ignored if {@code null})
* @param timeout
Value
timeout value in milliseconds (ignored if {@code null})
* @param timeoutResult the result supplier to use
* @since 5.1.1
*/
public
DeferredResult
(
@Nullable
Long
timeout
,
Supplier
<?>
timeoutResult
)
{
public
DeferredResult
(
@Nullable
Long
timeout
Value
,
Supplier
<?>
timeoutResult
)
{
this
.
timeoutResult
=
timeoutResult
;
this
.
timeout
=
timeout
;
this
.
timeout
Value
=
timeoutValue
;
}
/**
* Return {@code true} if this DeferredResult is no longer usable either
* because it was previously set or because the underlying request expired.
...
...
@@ -154,7 +155,7 @@ public class DeferredResult<T> {
*/
@Nullable
final
Long
getTimeoutValue
()
{
return
this
.
timeout
;
return
this
.
timeout
Value
;
}
/**
...
...
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java
浏览文件 @
171e8f56
/*
* 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.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录