Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
9789db23
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,发现更多精彩内容 >>
提交
9789db23
编写于
12月 28, 2015
作者:
R
Rossen Stoyanchev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename HandlerResult fields from value to result
上级
84e3ad34
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
20 deletion
+20
-20
spring-web-reactive/src/main/java/org/springframework/web/reactive/DispatcherHandler.java
...a/org/springframework/web/reactive/DispatcherHandler.java
+1
-1
spring-web-reactive/src/main/java/org/springframework/web/reactive/HandlerResult.java
.../java/org/springframework/web/reactive/HandlerResult.java
+10
-10
spring-web-reactive/src/main/java/org/springframework/web/reactive/handler/SimpleHandlerResultHandler.java
...work/web/reactive/handler/SimpleHandlerResultHandler.java
+3
-3
spring-web-reactive/src/main/java/org/springframework/web/reactive/method/annotation/ResponseBodyResultHandler.java
...reactive/method/annotation/ResponseBodyResultHandler.java
+2
-2
spring-web-reactive/src/test/java/org/springframework/web/reactive/method/InvocableHandlerMethodTests.java
...work/web/reactive/method/InvocableHandlerMethodTests.java
+4
-4
未找到文件。
spring-web-reactive/src/main/java/org/springframework/web/reactive/DispatcherHandler.java
浏览文件 @
9789db23
...
@@ -151,7 +151,7 @@ public class DispatcherHandler implements HttpHandler, ApplicationContextAware {
...
@@ -151,7 +151,7 @@ public class DispatcherHandler implements HttpHandler, ApplicationContextAware {
return
resultHandler
;
return
resultHandler
;
}
}
}
}
throw
new
IllegalStateException
(
"No HandlerResultHandler for "
+
handlerResult
.
get
Value
());
throw
new
IllegalStateException
(
"No HandlerResultHandler for "
+
handlerResult
.
get
Result
());
}
}
...
...
spring-web-reactive/src/main/java/org/springframework/web/reactive/HandlerResult.java
浏览文件 @
9789db23
...
@@ -28,17 +28,17 @@ public class HandlerResult {
...
@@ -28,17 +28,17 @@ public class HandlerResult {
private
final
Object
handler
;
private
final
Object
handler
;
private
final
Object
value
;
private
final
Object
result
;
private
final
ResolvableType
value
Type
;
private
final
ResolvableType
result
Type
;
public
HandlerResult
(
Object
handler
,
Object
value
,
ResolvableType
value
Type
)
{
public
HandlerResult
(
Object
handler
,
Object
result
,
ResolvableType
result
Type
)
{
Assert
.
notNull
(
handler
,
"'handler' is required"
);
Assert
.
notNull
(
handler
,
"'handler' is required"
);
Assert
.
notNull
(
handler
,
"'
value
Type' is required"
);
Assert
.
notNull
(
handler
,
"'
result
Type' is required"
);
this
.
handler
=
handler
;
this
.
handler
=
handler
;
this
.
value
=
value
;
this
.
result
=
result
;
this
.
valueType
=
value
Type
;
this
.
resultType
=
result
Type
;
}
}
...
@@ -46,12 +46,12 @@ public class HandlerResult {
...
@@ -46,12 +46,12 @@ public class HandlerResult {
return
this
.
handler
;
return
this
.
handler
;
}
}
public
Object
get
Value
()
{
public
Object
get
Result
()
{
return
this
.
value
;
return
this
.
result
;
}
}
public
ResolvableType
get
Value
Type
()
{
public
ResolvableType
get
Result
Type
()
{
return
this
.
value
Type
;
return
this
.
result
Type
;
}
}
}
}
spring-web-reactive/src/main/java/org/springframework/web/reactive/handler/SimpleHandlerResultHandler.java
浏览文件 @
9789db23
...
@@ -64,7 +64,7 @@ public class SimpleHandlerResultHandler implements Ordered, HandlerResultHandler
...
@@ -64,7 +64,7 @@ public class SimpleHandlerResultHandler implements Ordered, HandlerResultHandler
@Override
@Override
public
boolean
supports
(
HandlerResult
result
)
{
public
boolean
supports
(
HandlerResult
result
)
{
ResolvableType
type
=
result
.
get
Value
Type
();
ResolvableType
type
=
result
.
get
Result
Type
();
return
type
!=
null
&&
Void
.
TYPE
.
equals
(
type
.
getRawClass
())
||
return
type
!=
null
&&
Void
.
TYPE
.
equals
(
type
.
getRawClass
())
||
(
Void
.
class
.
isAssignableFrom
(
type
.
getGeneric
(
0
).
getRawClass
())
&&
isConvertibleToPublisher
(
type
));
(
Void
.
class
.
isAssignableFrom
(
type
.
getGeneric
(
0
).
getRawClass
())
&&
isConvertibleToPublisher
(
type
));
}
}
...
@@ -78,8 +78,8 @@ public class SimpleHandlerResultHandler implements Ordered, HandlerResultHandler
...
@@ -78,8 +78,8 @@ public class SimpleHandlerResultHandler implements Ordered, HandlerResultHandler
public
Publisher
<
Void
>
handleResult
(
ServerHttpRequest
request
,
public
Publisher
<
Void
>
handleResult
(
ServerHttpRequest
request
,
ServerHttpResponse
response
,
HandlerResult
result
)
{
ServerHttpResponse
response
,
HandlerResult
result
)
{
Object
value
=
result
.
get
Value
();
Object
value
=
result
.
get
Result
();
if
(
Void
.
TYPE
.
equals
(
result
.
get
Value
Type
().
getRawClass
()))
{
if
(
Void
.
TYPE
.
equals
(
result
.
get
Result
Type
().
getRawClass
()))
{
return
response
.
writeHeaders
();
return
response
.
writeHeaders
();
}
}
Publisher
<
Void
>
completion
=
(
value
instanceof
Publisher
?
(
Publisher
<
Void
>)
value
:
this
.
conversionService
.
convert
(
value
,
Publisher
.
class
));
Publisher
<
Void
>
completion
=
(
value
instanceof
Publisher
?
(
Publisher
<
Void
>)
value
:
this
.
conversionService
.
convert
(
value
,
Publisher
.
class
));
...
...
spring-web-reactive/src/main/java/org/springframework/web/reactive/method/annotation/ResponseBodyResultHandler.java
浏览文件 @
9789db23
...
@@ -130,14 +130,14 @@ public class ResponseBodyResultHandler implements HandlerResultHandler, Ordered
...
@@ -130,14 +130,14 @@ public class ResponseBodyResultHandler implements HandlerResultHandler, Ordered
public
Publisher
<
Void
>
handleResult
(
ServerHttpRequest
request
,
public
Publisher
<
Void
>
handleResult
(
ServerHttpRequest
request
,
ServerHttpResponse
response
,
HandlerResult
result
)
{
ServerHttpResponse
response
,
HandlerResult
result
)
{
Object
value
=
result
.
get
Value
();
Object
value
=
result
.
get
Result
();
if
(
value
==
null
)
{
if
(
value
==
null
)
{
return
Publishers
.
empty
();
return
Publishers
.
empty
();
}
}
Publisher
<?>
publisher
;
Publisher
<?>
publisher
;
ResolvableType
elementType
;
ResolvableType
elementType
;
ResolvableType
returnType
=
result
.
get
Value
Type
();
ResolvableType
returnType
=
result
.
get
Result
Type
();
if
(
this
.
conversionService
.
canConvert
(
returnType
.
getRawClass
(),
Publisher
.
class
))
{
if
(
this
.
conversionService
.
canConvert
(
returnType
.
getRawClass
(),
Publisher
.
class
))
{
publisher
=
this
.
conversionService
.
convert
(
value
,
Publisher
.
class
);
publisher
=
this
.
conversionService
.
convert
(
value
,
Publisher
.
class
);
elementType
=
returnType
.
getGeneric
(
0
);
elementType
=
returnType
.
getGeneric
(
0
);
...
...
spring-web-reactive/src/test/java/org/springframework/web/reactive/method/InvocableHandlerMethodTests.java
浏览文件 @
9789db23
...
@@ -64,7 +64,7 @@ public class InvocableHandlerMethodTests {
...
@@ -64,7 +64,7 @@ public class InvocableHandlerMethodTests {
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
assertEquals
(
1
,
values
.
size
());
assertEquals
(
1
,
values
.
size
());
assertEquals
(
"success"
,
values
.
get
(
0
).
get
Value
());
assertEquals
(
"success"
,
values
.
get
(
0
).
get
Result
());
}
}
@Test
@Test
...
@@ -77,7 +77,7 @@ public class InvocableHandlerMethodTests {
...
@@ -77,7 +77,7 @@ public class InvocableHandlerMethodTests {
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
assertEquals
(
1
,
values
.
size
());
assertEquals
(
1
,
values
.
size
());
assertEquals
(
"success:null"
,
values
.
get
(
0
).
get
Value
());
assertEquals
(
"success:null"
,
values
.
get
(
0
).
get
Result
());
}
}
@Test
@Test
...
@@ -89,7 +89,7 @@ public class InvocableHandlerMethodTests {
...
@@ -89,7 +89,7 @@ public class InvocableHandlerMethodTests {
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
assertEquals
(
1
,
values
.
size
());
assertEquals
(
1
,
values
.
size
());
assertEquals
(
"success:value1"
,
values
.
get
(
0
).
get
Value
());
assertEquals
(
"success:value1"
,
values
.
get
(
0
).
get
Result
());
}
}
@Test
@Test
...
@@ -101,7 +101,7 @@ public class InvocableHandlerMethodTests {
...
@@ -101,7 +101,7 @@ public class InvocableHandlerMethodTests {
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
List
<
HandlerResult
>
values
=
Streams
.
wrap
(
publisher
).
toList
().
await
(
5
,
TimeUnit
.
SECONDS
);
assertEquals
(
1
,
values
.
size
());
assertEquals
(
1
,
values
.
size
());
assertEquals
(
"success:value1"
,
values
.
get
(
0
).
get
Value
());
assertEquals
(
"success:value1"
,
values
.
get
(
0
).
get
Result
());
}
}
@Test
@Test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录