Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
058714b0
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 搜索 >>
提交
058714b0
编写于
2月 10, 2015
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
7585be85
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
36 addition
and
42 deletion
+36
-42
spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
...ramework/context/support/ResourceBundleMessageSource.java
+4
-1
spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java
...a/org/springframework/util/AlternativeJdkIdGenerator.java
+1
-1
spring-core/src/main/java/org/springframework/util/JdkIdGenerator.java
...rc/main/java/org/springframework/util/JdkIdGenerator.java
+1
-1
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractMethodArgumentResolutionException.java
...on/support/AbstractMethodArgumentResolutionException.java
+7
-7
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java
...r/annotation/support/MethodArgumentNotValidException.java
+6
-7
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentTypeMismatchException.java
...notation/support/MethodArgumentTypeMismatchException.java
+4
-4
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/HandlerMethodArgumentResolver.java
...ing/handler/invocation/HandlerMethodArgumentResolver.java
+7
-7
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandler.java
...ork/messaging/simp/broker/SimpleBrokerMessageHandler.java
+5
-8
spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java
...work/http/converter/json/Jackson2ObjectMapperBuilder.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyAdviceChain.java
...ervlet/mvc/method/annotation/ResponseBodyAdviceChain.java
+0
-5
未找到文件。
spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java
浏览文件 @
058714b0
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -394,6 +394,8 @@ public class ResourceBundleMessageSource extends AbstractMessageSource implement
@Override
public
ResourceBundle
newBundle
(
String
baseName
,
Locale
locale
,
String
format
,
ClassLoader
loader
,
boolean
reload
)
throws
IllegalAccessException
,
InstantiationException
,
IOException
{
// Special handling of default encoding
if
(
format
.
equals
(
"java.properties"
))
{
String
bundleName
=
toBundleName
(
baseName
,
locale
);
final
String
resourceName
=
toResourceName
(
bundleName
,
"properties"
);
...
...
@@ -441,6 +443,7 @@ public class ResourceBundleMessageSource extends AbstractMessageSource implement
}
}
else
{
// Delegate handling of "java.class" format to standard Control
return
super
.
newBundle
(
baseName
,
locale
,
format
,
loader
,
reload
);
}
}
...
...
spring-core/src/main/java/org/springframework/util/AlternativeJdkIdGenerator.java
浏览文件 @
058714b0
...
...
@@ -45,8 +45,8 @@ public class AlternativeJdkIdGenerator implements IdGenerator {
}
@Override
public
UUID
generateId
()
{
byte
[]
randomBytes
=
new
byte
[
16
];
this
.
random
.
nextBytes
(
randomBytes
);
...
...
spring-core/src/main/java/org/springframework/util/JdkIdGenerator.java
浏览文件 @
058714b0
...
...
@@ -27,7 +27,7 @@ import java.util.UUID;
*/
public
class
JdkIdGenerator
implements
IdGenerator
{
@Override
public
UUID
generateId
()
{
return
UUID
.
randomUUID
();
}
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractMethodArgumentResolutionException.java
浏览文件 @
058714b0
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -42,23 +42,23 @@ public abstract class AbstractMethodArgumentResolutionException extends Messagin
/**
* Create a new instance providing the invalid {@code MethodParameter} and
* a prepared description. Sub
-
classes should prepend the description with
* a prepared description. Subclasses should prepend the description with
* the help of {@link #getMethodParamMessage(org.springframework.core.MethodParameter)}.
*/
protected
AbstractMethodArgumentResolutionException
(
Message
<?>
message
,
MethodParameter
parameter
,
String
description
)
{
protected
AbstractMethodArgumentResolutionException
(
Message
<?>
message
,
MethodParameter
param
,
String
description
)
{
super
(
message
,
description
);
this
.
parameter
=
param
eter
;
this
.
parameter
=
param
;
}
/**
* Return the MethodParameter that was rejected.
*/
public
MethodParameter
getMethodParameter
()
{
public
final
MethodParameter
getMethodParameter
()
{
return
this
.
parameter
;
}
protected
static
String
getMethodParamMessage
(
MethodParameter
param
)
{
return
new
StringBuilder
(
"Could not resolve method parameter at index "
)
.
append
(
param
.
getParameterIndex
()).
append
(
" in method: "
)
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java
浏览文件 @
058714b0
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -49,22 +49,21 @@ public class MethodArgumentNotValidException extends AbstractMethodArgumentResol
public
MethodArgumentNotValidException
(
Message
<?>
message
,
MethodParameter
parameter
,
BindingResult
bindingResult
)
{
super
(
message
,
parameter
,
getMethodParamMessage
(
parameter
)
+
getValidationErrorMessage
(
parameter
,
bindingResult
));
super
(
message
,
parameter
,
getMethodParamMessage
(
parameter
)
+
getValidationErrorMessage
(
bindingResult
));
this
.
bindingResult
=
bindingResult
;
}
/**
* Return the BindingResult if the failure is validation-related or {@code null}.
* Return the BindingResult if the failure is validation-related,
* or {@code null} if none.
*/
public
BindingResult
getBindingResult
()
{
public
final
BindingResult
getBindingResult
()
{
return
this
.
bindingResult
;
}
private
static
String
getValidationErrorMessage
(
MethodParameter
parameter
,
BindingResult
bindingResult
)
{
private
static
String
getValidationErrorMessage
(
BindingResult
bindingResult
)
{
if
(
bindingResult
!=
null
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
", with "
).
append
(
bindingResult
.
getErrorCount
()).
append
(
" error(s): "
);
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentTypeMismatchException.java
浏览文件 @
058714b0
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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,11 +29,11 @@ import org.springframework.messaging.Message;
@SuppressWarnings
(
"serial"
)
public
class
MethodArgumentTypeMismatchException
extends
AbstractMethodArgumentResolutionException
{
/**
* Create a new instance with the invalid {@code MethodParameter}.
*/
public
MethodArgumentTypeMismatchException
(
Message
<?>
message
,
MethodParameter
param
eter
,
String
description
)
{
super
(
message
,
param
eter
,
getMethodParamMessage
(
parameter
)
+
description
);
public
MethodArgumentTypeMismatchException
(
Message
<?>
message
,
MethodParameter
param
,
String
description
)
{
super
(
message
,
param
,
getMethodParamMessage
(
param
)
+
description
);
}
}
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/HandlerMethodArgumentResolver.java
浏览文件 @
058714b0
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -20,8 +20,8 @@ import org.springframework.core.MethodParameter;
import
org.springframework.messaging.Message
;
/**
* Strategy interface for resolving method parameters into argument values
in
* the context of a given {@link Message}.
* Strategy interface for resolving method parameters into argument values
*
in
the context of a given {@link Message}.
*
* @author Rossen Stoyanchev
* @since 4.0
...
...
@@ -39,12 +39,12 @@ public interface HandlerMethodArgumentResolver {
/**
* Resolves a method parameter into an argument value from a given message.
* @param parameter the method parameter to resolve.
This parameter must
* have previously been passed to
* @param parameter the method parameter to resolve.
*
This parameter must
have previously been passed to
* {@link #supportsParameter(org.springframework.core.MethodParameter)}
*
and it must have returned {@code true}
*
which must have returned {@code true}.
* @param message the currently processed message
* @return the resolved argument value, or {@code null}
.
* @return the resolved argument value, or {@code null}
* @throws Exception in case of errors with the preparation of argument values
*/
Object
resolveArgument
(
MethodParameter
parameter
,
Message
<?>
message
)
throws
Exception
;
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandler.java
浏览文件 @
058714b0
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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,6 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
/**
* Configure a custom SubscriptionRegistry to use for storing subscriptions.
*
* <p><strong>Note</strong> that when a custom PathMatcher is configured via
* {@link #setPathMatcher}, if the custom registry is not an instance of
* {@link DefaultSubscriptionRegistry}, the provided PathMatcher is not used
...
...
@@ -102,9 +101,8 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
}
/**
* Configure a {@link MessageHeaderInitializer} to apply to the headers of all
* messages sent to the client outbound channel.
*
* Configure a {@link MessageHeaderInitializer} to apply to the headers
* of all messages sent to the client outbound channel.
* <p>By default this property is not set.
*/
public
void
setHeaderInitializer
(
MessageHeaderInitializer
headerInitializer
)
{
...
...
@@ -112,7 +110,7 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
}
/**
*
@r
eturn the configured header initializer.
*
R
eturn the configured header initializer.
*/
public
MessageHeaderInitializer
getHeaderInitializer
()
{
return
this
.
headerInitializer
;
...
...
@@ -131,7 +129,6 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
@Override
protected
void
handleMessageInternal
(
Message
<?>
message
)
{
MessageHeaders
headers
=
message
.
getHeaders
();
SimpMessageType
messageType
=
SimpMessageHeaderAccessor
.
getMessageType
(
headers
);
String
destination
=
SimpMessageHeaderAccessor
.
getDestination
(
headers
);
...
...
@@ -197,7 +194,7 @@ public class SimpleBrokerMessageHandler extends AbstractBrokerMessageHandler {
protected
void
sendMessageToSubscribers
(
String
destination
,
Message
<?>
message
)
{
MultiValueMap
<
String
,
String
>
subscriptions
=
this
.
subscriptionRegistry
.
findSubscriptions
(
message
);
if
(
(
subscriptions
.
size
()
>
0
)
&&
logger
.
isDebugEnabled
())
{
if
(
!
subscriptions
.
isEmpty
(
)
&&
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Broadcasting to "
+
subscriptions
.
size
()
+
" sessions."
);
}
for
(
String
sessionId
:
subscriptions
.
keySet
())
{
...
...
spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java
浏览文件 @
058714b0
...
...
@@ -272,7 +272,7 @@ public class Jackson2ObjectMapperBuilder {
* @see com.fasterxml.jackson.databind.ObjectMapper#addMixInAnnotations(Class, Class)
*/
public
Jackson2ObjectMapperBuilder
mixIn
(
Class
<?>
target
,
Class
<?>
mixinSource
)
{
if
(
mix
Ins
!=
null
)
{
if
(
mix
inSource
!=
null
)
{
this
.
mixIns
.
put
(
target
,
mixinSource
);
}
return
this
;
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ResponseBodyAdviceChain.java
浏览文件 @
058714b0
...
...
@@ -18,9 +18,6 @@ package org.springframework.web.servlet.mvc.method.annotation;
import
java.util.List
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.converter.HttpMessageConverter
;
...
...
@@ -37,8 +34,6 @@ import org.springframework.web.method.ControllerAdviceBean;
*/
class
ResponseBodyAdviceChain
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ResponseBodyAdviceChain
.
class
);
private
final
List
<
Object
>
advice
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录