Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
c4622dbe
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 搜索 >>
提交
c4622dbe
编写于
7月 30, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
9a36027a
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
40 addition
and
52 deletion
+40
-52
spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java
...gframework/beans/factory/config/DependencyDescriptor.java
+1
-1
spring-context/src/main/java/org/springframework/validation/ObjectError.java
...main/java/org/springframework/validation/ObjectError.java
+2
-2
spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
...ingframework/jms/connection/CachingConnectionFactory.java
+1
-1
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/HandlerMethodArgumentResolverComposite.java
...er/invocation/HandlerMethodArgumentResolverComposite.java
+3
-4
spring-test/src/main/java/org/springframework/test/context/web/WebMergedContextConfiguration.java
...ework/test/context/web/WebMergedContextConfiguration.java
+2
-2
spring-web/src/main/java/org/springframework/http/HttpStatus.java
...eb/src/main/java/org/springframework/http/HttpStatus.java
+6
-1
spring-web/src/main/java/org/springframework/http/ResponseEntity.java
...rc/main/java/org/springframework/http/ResponseEntity.java
+2
-2
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpResponse.java
...work/http/server/reactive/AbstractServerHttpResponse.java
+1
-1
spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpResponse.java
...ework/http/server/reactive/ReactorServerHttpResponse.java
+2
-8
spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpResponse.java
...ework/http/server/reactive/ServletServerHttpResponse.java
+2
-2
spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpResponse.java
...work/http/server/reactive/UndertowServerHttpResponse.java
+3
-4
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolverComposite.java
...ethod/support/HandlerMethodArgumentResolverComposite.java
+3
-4
spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodArgumentResolverCompositeTests.java
.../support/HandlerMethodArgumentResolverCompositeTests.java
+3
-3
spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerCompositeTests.java
...upport/HandlerMethodReturnValueHandlerCompositeTests.java
+5
-5
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientResponseBuilder.java
...eactive/function/client/DefaultClientResponseBuilder.java
+1
-3
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java
...mework/web/reactive/function/client/DefaultWebClient.java
+1
-6
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java
...ringframework/web/reactive/function/client/WebClient.java
+2
-3
未找到文件。
spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java
浏览文件 @
c4622dbe
...
...
@@ -430,7 +430,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
@Override
public
int
hashCode
()
{
return
31
*
super
.
hashCode
()
+
ObjectUtils
.
nullSafeHashCode
(
this
.
containingClass
);
return
(
31
*
super
.
hashCode
()
+
ObjectUtils
.
nullSafeHashCode
(
this
.
containingClass
)
);
}
...
...
spring-context/src/main/java/org/springframework/validation/ObjectError.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -144,7 +144,7 @@ public class ObjectError extends DefaultMessageSourceResolvable {
@Override
public
int
hashCode
()
{
return
super
.
hashCode
()
*
29
+
getObjectName
().
hashCode
(
);
return
(
29
*
super
.
hashCode
()
+
getObjectName
().
hashCode
()
);
}
@Override
...
...
spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java
浏览文件 @
c4622dbe
...
...
@@ -591,7 +591,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
@Override
public
int
hashCode
()
{
return
31
*
super
.
hashCode
()
+
ObjectUtils
.
nullSafeHashCode
(
this
.
selector
);
return
(
31
*
super
.
hashCode
()
+
ObjectUtils
.
nullSafeHashCode
(
this
.
selector
)
);
}
@Override
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/HandlerMethodArgumentResolverComposite.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -110,9 +110,8 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
public
Object
resolveArgument
(
MethodParameter
parameter
,
Message
<?>
message
)
throws
Exception
{
HandlerMethodArgumentResolver
resolver
=
getArgumentResolver
(
parameter
);
if
(
resolver
==
null
)
{
throw
new
IllegalStateException
(
"Unsupported parameter type ["
+
parameter
.
getParameterType
().
getName
()
+
"]."
+
" supportsParameter should be called first."
);
throw
new
IllegalArgumentException
(
"Unsupported parameter type ["
+
parameter
.
getParameterType
().
getName
()
+
"]. supportsParameter should be called first."
);
}
return
resolver
.
resolveArgument
(
parameter
,
message
);
}
...
...
spring-test/src/main/java/org/springframework/test/context/web/WebMergedContextConfiguration.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -178,7 +178,7 @@ public class WebMergedContextConfiguration extends MergedContextConfiguration {
*/
@Override
public
int
hashCode
()
{
return
super
.
hashCode
()
*
31
+
this
.
resourceBasePath
.
hashCode
(
);
return
(
31
*
super
.
hashCode
()
+
this
.
resourceBasePath
.
hashCode
()
);
}
/**
...
...
spring-web/src/main/java/org/springframework/http/HttpStatus.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -447,6 +447,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#INFORMATIONAL}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public
boolean
is1xxInformational
()
{
...
...
@@ -457,6 +458,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#SUCCESSFUL}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public
boolean
is2xxSuccessful
()
{
...
...
@@ -467,6 +469,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#REDIRECTION}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public
boolean
is3xxRedirection
()
{
...
...
@@ -477,6 +480,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public
boolean
is4xxClientError
()
{
...
...
@@ -487,6 +491,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public
boolean
is5xxServerError
()
{
...
...
spring-web/src/main/java/org/springframework/http/ResponseEntity.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -169,7 +169,7 @@ public class ResponseEntity<T> extends HttpEntity<T> {
@Override
public
int
hashCode
()
{
return
(
super
.
hashCode
()
*
29
+
ObjectUtils
.
nullSafeHashCode
(
this
.
status
));
return
(
29
*
super
.
hashCode
()
+
ObjectUtils
.
nullSafeHashCode
(
this
.
status
));
}
@Override
...
...
spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpResponse.java
浏览文件 @
c4622dbe
...
...
@@ -109,7 +109,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
@Override
@Nullable
public
HttpStatus
getStatusCode
()
{
return
this
.
statusCode
!=
null
?
HttpStatus
.
resolve
(
this
.
statusCode
)
:
null
;
return
(
this
.
statusCode
!=
null
?
HttpStatus
.
resolve
(
this
.
statusCode
)
:
null
)
;
}
/**
...
...
spring-web/src/main/java/org/springframework/http/server/reactive/ReactorServerHttpResponse.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -19,7 +19,6 @@ package org.springframework.http.server.reactive;
import
java.nio.file.Path
;
import
io.netty.buffer.ByteBuf
;
import
io.netty.handler.codec.http.HttpResponseStatus
;
import
io.netty.handler.codec.http.cookie.Cookie
;
import
io.netty.handler.codec.http.cookie.DefaultCookie
;
import
org.reactivestreams.Publisher
;
...
...
@@ -62,14 +61,9 @@ class ReactorServerHttpResponse extends AbstractServerHttpResponse implements Ze
}
@Override
@SuppressWarnings
(
"ConstantConditions"
)
public
HttpStatus
getStatusCode
()
{
HttpStatus
httpStatus
=
super
.
getStatusCode
();
if
(
httpStatus
==
null
)
{
HttpResponseStatus
status
=
this
.
response
.
status
();
httpStatus
=
status
!=
null
?
HttpStatus
.
resolve
(
status
.
code
())
:
null
;
}
return
httpStatus
;
return
(
httpStatus
!=
null
?
httpStatus
:
HttpStatus
.
resolve
(
this
.
response
.
status
().
code
()));
}
...
...
spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpResponse.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -100,7 +100,7 @@ class ServletServerHttpResponse extends AbstractListenerServerHttpResponse {
@Override
public
HttpStatus
getStatusCode
()
{
HttpStatus
httpStatus
=
super
.
getStatusCode
();
return
httpStatus
!=
null
?
httpStatus
:
HttpStatus
.
resolve
(
this
.
response
.
getStatus
(
));
return
(
httpStatus
!=
null
?
httpStatus
:
HttpStatus
.
resolve
(
this
.
response
.
getStatus
()
));
}
@Override
...
...
spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpResponse.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -69,8 +69,7 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
}
private
static
HttpHeaders
createHeaders
(
HttpServerExchange
exchange
)
{
UndertowHeadersAdapter
headersMap
=
new
UndertowHeadersAdapter
(
exchange
.
getResponseHeaders
());
UndertowHeadersAdapter
headersMap
=
new
UndertowHeadersAdapter
(
exchange
.
getResponseHeaders
());
return
new
HttpHeaders
(
headersMap
);
}
...
...
@@ -84,7 +83,7 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
@Override
public
HttpStatus
getStatusCode
()
{
HttpStatus
httpStatus
=
super
.
getStatusCode
();
return
httpStatus
!=
null
?
httpStatus
:
HttpStatus
.
resolve
(
this
.
exchange
.
getStatusCode
(
));
return
(
httpStatus
!=
null
?
httpStatus
:
HttpStatus
.
resolve
(
this
.
exchange
.
getStatusCode
()
));
}
...
...
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolverComposite.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -119,9 +119,8 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
HandlerMethodArgumentResolver
resolver
=
getArgumentResolver
(
parameter
);
if
(
resolver
==
null
)
{
throw
new
IllegalArgumentException
(
"Unsupported parameter type ["
+
parameter
.
getParameterType
().
getName
()
+
"]."
+
" supportsParameter should be called first."
);
throw
new
IllegalArgumentException
(
"Unsupported parameter type ["
+
parameter
.
getParameterType
().
getName
()
+
"]. supportsParameter should be called first."
);
}
return
resolver
.
resolveArgument
(
parameter
,
mavContainer
,
webRequest
,
binderFactory
);
}
...
...
spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodArgumentResolverCompositeTests.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -40,7 +40,7 @@ public class HandlerMethodArgumentResolverCompositeTests {
@Before
public
void
set
U
p
()
throws
Exception
{
public
void
set
u
p
()
throws
Exception
{
this
.
resolverComposite
=
new
HandlerMethodArgumentResolverComposite
();
Method
method
=
getClass
().
getDeclaredMethod
(
"handle"
,
Integer
.
class
,
String
.
class
);
...
...
@@ -50,7 +50,7 @@ public class HandlerMethodArgumentResolverCompositeTests {
@Test
public
void
supportsParameter
()
{
public
void
supportsParameter
()
throws
Exception
{
this
.
resolverComposite
.
addResolver
(
new
StubArgumentResolver
(
Integer
.
class
));
assertTrue
(
this
.
resolverComposite
.
supportsParameter
(
paramInt
));
...
...
spring-web/src/test/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerCompositeTests.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -30,6 +30,7 @@ import static org.mockito.Mockito.when;
/**
* Test fixture with {@link HandlerMethodReturnValueHandlerComposite}.
*
* @author Rossen Stoyanchev
*/
@SuppressWarnings
(
"unused"
)
...
...
@@ -47,8 +48,7 @@ public class HandlerMethodReturnValueHandlerCompositeTests {
@Before
public
void
setUp
()
throws
Exception
{
public
void
setup
()
throws
Exception
{
this
.
integerType
=
new
MethodParameter
(
getClass
().
getDeclaredMethod
(
"handleInteger"
),
-
1
);
this
.
stringType
=
new
MethodParameter
(
getClass
().
getDeclaredMethod
(
"handleString"
),
-
1
);
...
...
@@ -61,6 +61,7 @@ public class HandlerMethodReturnValueHandlerCompositeTests {
mavContainer
=
new
ModelAndViewContainer
();
}
@Test
public
void
supportsReturnType
()
throws
Exception
{
assertTrue
(
this
.
handlers
.
supportsReturnType
(
this
.
integerType
));
...
...
@@ -84,9 +85,8 @@ public class HandlerMethodReturnValueHandlerCompositeTests {
verifyNoMoreInteractions
(
anotherIntegerHandler
);
}
@Test
// SPR-13083
@Test
// SPR-13083
public
void
handleReturnValueWithAsyncHandler
()
throws
Exception
{
Promise
<
Integer
>
promise
=
new
Promise
<>();
MethodParameter
promiseType
=
new
MethodParameter
(
getClass
().
getDeclaredMethod
(
"handlePromise"
),
-
1
);
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientResponseBuilder.java
浏览文件 @
c4622dbe
/*
* 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.
...
...
@@ -129,13 +129,11 @@ final class DefaultClientResponseBuilder implements ClientResponse.Builder {
@Override
public
ClientResponse
build
()
{
ClientHttpResponse
httpResponse
=
new
BuiltClientHttpResponse
(
this
.
statusCode
,
this
.
headers
,
this
.
cookies
,
this
.
body
);
// When building ClientResponse manually, the ClientRequest.logPrefix() has to be passed,
// e.g. via ClientResponse.Builder, but this (builder) is not used currently.
return
new
DefaultClientResponse
(
httpResponse
,
this
.
strategies
,
""
);
}
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java
浏览文件 @
c4622dbe
...
...
@@ -423,7 +423,7 @@ class DefaultWebClient implements WebClient {
private
static
IntPredicate
toIntPredicate
(
Predicate
<
HttpStatus
>
predicate
)
{
return
value
->
{
HttpStatus
status
=
HttpStatus
.
resolve
(
value
);
return
(
status
!=
null
)
&&
predicate
.
test
(
status
);
return
(
status
!=
null
&&
predicate
.
test
(
status
)
);
};
}
...
...
@@ -436,7 +436,6 @@ class DefaultWebClient implements WebClient {
}
this
.
statusHandlers
.
add
(
new
StatusHandler
(
statusCodePredicate
,
(
clientResponse
,
request
)
->
exceptionFunction
.
apply
(
clientResponse
)));
return
this
;
}
...
...
@@ -539,8 +538,6 @@ class DefaultWebClient implements WebClient {
public
StatusHandler
(
IntPredicate
predicate
,
BiFunction
<
ClientResponse
,
HttpRequest
,
Mono
<?
extends
Throwable
>>
exceptionFunction
)
{
Assert
.
notNull
(
predicate
,
"Predicate must not be null"
);
Assert
.
notNull
(
exceptionFunction
,
"Function must not be null"
);
this
.
predicate
=
predicate
;
this
.
exceptionFunction
=
exceptionFunction
;
}
...
...
@@ -552,8 +549,6 @@ class DefaultWebClient implements WebClient {
public
Mono
<?
extends
Throwable
>
apply
(
ClientResponse
response
,
HttpRequest
request
)
{
return
this
.
exceptionFunction
.
apply
(
response
,
request
);
}
}
}
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java
浏览文件 @
c4622dbe
...
...
@@ -583,6 +583,7 @@ public interface WebClient {
RequestHeadersSpec
<?>
syncBody
(
Object
body
);
}
/**
* Contract for specifying response operations following the exchange.
*/
...
...
@@ -666,24 +667,22 @@ public interface WebClient {
* status code is 4xx or 5xx
*/
<
T
>
Flux
<
T
>
bodyToFlux
(
ParameterizedTypeReference
<
T
>
typeReference
);
}
/**
* Contract for specifying request headers and URI for a request.
*
* @param <S> a self reference to the spec type
*/
interface
RequestHeadersUriSpec
<
S
extends
RequestHeadersSpec
<
S
>>
extends
UriSpec
<
S
>,
RequestHeadersSpec
<
S
>
{
}
/**
* Contract for specifying request headers, body and URI for a request.
*/
interface
RequestBodyUriSpec
extends
RequestBodySpec
,
RequestHeadersUriSpec
<
RequestBodySpec
>
{
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录