Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
6c87ef09
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,发现更多精彩内容 >>
提交
6c87ef09
编写于
3月 07, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
b8f29962
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
117 addition
and
110 deletion
+117
-110
spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java
...g/springframework/beans/factory/config/YamlProcessor.java
+2
-6
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
...amework/beans/factory/support/AbstractBeanDefinition.java
+2
-2
spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java
...gframework/context/annotation/DeferredImportSelector.java
+14
-11
spring-context/src/main/java/org/springframework/context/annotation/ImportBeanDefinitionRegistrar.java
...ork/context/annotation/ImportBeanDefinitionRegistrar.java
+2
-3
spring-context/src/main/java/org/springframework/context/annotation/ImportSelector.java
...rg/springframework/context/annotation/ImportSelector.java
+8
-8
spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
...framework/context/support/AbstractApplicationContext.java
+6
-6
spring-core/src/main/java/org/springframework/util/ObjectUtils.java
...e/src/main/java/org/springframework/util/ObjectUtils.java
+21
-21
spring-jms/src/main/java/org/springframework/jms/config/MethodJmsListenerEndpoint.java
...springframework/jms/config/MethodJmsListenerEndpoint.java
+5
-2
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java
...r/annotation/support/MethodArgumentNotValidException.java
+2
-1
spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java
...aging/simp/config/AbstractMessageBrokerConfiguration.java
+9
-8
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompDecoder.java
...rg/springframework/messaging/simp/stomp/StompDecoder.java
+2
-2
spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java
...ramework/messaging/simp/user/MultiServerUserRegistry.java
+2
-2
spring-test/src/main/java/org/springframework/test/context/TestContext.java
...in/java/org/springframework/test/context/TestContext.java
+6
-4
spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultMockServerSpec.java
...ework/test/web/reactive/server/DefaultMockServerSpec.java
+3
-2
spring-test/src/main/java/org/springframework/test/web/reactive/server/MockServerConfigurer.java
...mework/test/web/reactive/server/MockServerConfigurer.java
+3
-2
spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClientConfigurer.java
...ork/test/web/reactive/server/WebTestClientConfigurer.java
+2
-1
spring-test/src/main/java/org/springframework/test/web/reactive/server/XpathAssertions.java
...ngframework/test/web/reactive/server/XpathAssertions.java
+1
-2
spring-webflux/src/main/java/org/springframework/web/reactive/result/condition/AbstractRequestCondition.java
...b/reactive/result/condition/AbstractRequestCondition.java
+25
-25
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractRequestCondition.java
...k/web/servlet/mvc/condition/AbstractRequestCondition.java
+2
-2
未找到文件。
spring-beans/src/main/java/org/springframework/beans/factory/config/YamlProcessor.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -156,8 +156,7 @@ public abstract class YamlProcessor {
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Loading from YAML: "
+
resource
);
}
Reader
reader
=
new
UnicodeReader
(
resource
.
getInputStream
());
try
{
try
(
Reader
reader
=
new
UnicodeReader
(
resource
.
getInputStream
()))
{
for
(
Object
object
:
yaml
.
loadAll
(
reader
))
{
if
(
object
!=
null
&&
process
(
asMap
(
object
),
callback
))
{
count
++;
...
...
@@ -171,9 +170,6 @@ public abstract class YamlProcessor {
" from YAML resource: "
+
resource
);
}
}
finally
{
reader
.
close
();
}
}
catch
(
IOException
ex
)
{
handleProcessError
(
resource
,
ex
);
...
...
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -663,7 +663,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Return whether this bean has the specified qualifier.
*/
public
boolean
hasQualifier
(
String
typeName
)
{
return
this
.
qualifiers
.
keySet
().
contains
(
typeName
);
return
this
.
qualifiers
.
containsKey
(
typeName
);
}
/**
...
...
spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java
浏览文件 @
6c87ef09
/*
* 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,8 +40,10 @@ import org.springframework.lang.Nullable;
public
interface
DeferredImportSelector
extends
ImportSelector
{
/**
* Return a specific import group or {@code null} if no grouping is required.
* @return the import group class or {@code null}
* Return a specific import group.
* <p>The default implementations return {@code null} for no grouping required.
* @return the import group class, or {@code null} if none
* @since 5.0
*/
@Nullable
default
Class
<?
extends
Group
>
getImportGroup
()
{
...
...
@@ -61,11 +63,12 @@ public interface DeferredImportSelector extends ImportSelector {
void
process
(
AnnotationMetadata
metadata
,
DeferredImportSelector
selector
);
/**
* Return the {@link Entry entries} of which class(es) should be imported
for this
* group.
* Return the {@link Entry entries} of which class(es) should be imported
*
for this
group.
*/
Iterable
<
Entry
>
selectImports
();
/**
* An entry that holds the {@link AnnotationMetadata} of the importing
* {@link Configuration} class and the class name to import.
...
...
@@ -97,16 +100,16 @@ public interface DeferredImportSelector extends ImportSelector {
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
public
boolean
equals
(
Object
o
ther
)
{
if
(
this
==
o
ther
)
{
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
if
(
o
ther
==
null
||
getClass
()
!=
other
.
getClass
())
{
return
false
;
}
Entry
entry
=
(
Entry
)
o
;
return
Objects
.
equals
(
this
.
metadata
,
entry
.
metadata
)
&&
Objects
.
equals
(
this
.
importClassName
,
entry
.
importClassName
);
Entry
entry
=
(
Entry
)
o
ther
;
return
(
Objects
.
equals
(
this
.
metadata
,
entry
.
metadata
)
&&
Objects
.
equals
(
this
.
importClassName
,
entry
.
importClassName
)
)
;
}
@Override
...
...
spring-context/src/main/java/org/springframework/context/annotation/ImportBeanDefinitionRegistrar.java
浏览文件 @
6c87ef09
/*
* Copyright 2002-201
3
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.
...
...
@@ -58,7 +58,6 @@ public interface ImportBeanDefinitionRegistrar {
* @param importingClassMetadata annotation metadata of the importing class
* @param registry current bean definition registry
*/
public
void
registerBeanDefinitions
(
AnnotationMetadata
importingClassMetadata
,
BeanDefinitionRegistry
registry
);
void
registerBeanDefinitions
(
AnnotationMetadata
importingClassMetadata
,
BeanDefinitionRegistry
registry
);
}
spring-context/src/main/java/org/springframework/context/annotation/ImportSelector.java
浏览文件 @
6c87ef09
...
...
@@ -20,12 +20,12 @@ import org.springframework.core.type.AnnotationMetadata;
/**
* Interface to be implemented by types that determine which @{@link Configuration}
* class(es) should be imported based on a given selection criteria, usually one or
more
* annotation attributes.
* class(es) should be imported based on a given selection criteria, usually one or
*
more
annotation attributes.
*
* <p>An {@link ImportSelector} may implement any of the following
* {@link org.springframework.beans.factory.Aware Aware} interfaces,
and their respective
* methods will be called prior to {@link #selectImports}:
* {@link org.springframework.beans.factory.Aware Aware} interfaces,
*
and their respective
methods will be called prior to {@link #selectImports}:
* <ul>
* <li>{@link org.springframework.context.EnvironmentAware EnvironmentAware}</li>
* <li>{@link org.springframework.beans.factory.BeanFactoryAware BeanFactoryAware}</li>
...
...
@@ -33,10 +33,10 @@ import org.springframework.core.type.AnnotationMetadata;
* <li>{@link org.springframework.context.ResourceLoaderAware ResourceLoaderAware}</li>
* </ul>
*
* <p>
ImportSelectors are usually processed in the same way as regular {@code @Import}
* a
nnotations, however, it is also possible to defer selection of imports until all
*
{@code @Configuration} classes have been processed (see {@link DeferredImportSelector}
* for details).
* <p>
{@code ImportSelector} implementations are usually processed in the same way
* a
s regular {@code @Import} annotations, however, it is also possible to defer
*
selection of imports until all {@code @Configuration} classes have been processed
*
(see {@link DeferredImportSelector}
for details).
*
* @author Chris Beams
* @since 3.1
...
...
spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
浏览文件 @
6c87ef09
...
...
@@ -92,24 +92,24 @@ import org.springframework.util.ReflectionUtils;
* to detect special beans defined in its internal bean factory:
* Therefore, this class automatically registers
* {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor BeanFactoryPostProcessors},
* {@link org.springframework.beans.factory.config.BeanPostProcessor BeanPostProcessors}
* {@link org.springframework.beans.factory.config.BeanPostProcessor BeanPostProcessors}
,
* and {@link org.springframework.context.ApplicationListener ApplicationListeners}
* which are defined as beans in the context.
*
* <p>A {@link org.springframework.context.MessageSource} may also be supplied
* as a bean in the context, with the name "messageSource"; otherwise, message
* resolution is delegated to the parent context. Furthermore, a multicaster
* for application events can be supplied as "applicationEventMulticaster" bean
* for application events can be supplied as
an
"applicationEventMulticaster" bean
* of type {@link org.springframework.context.event.ApplicationEventMulticaster}
* in the context; otherwise, a default multicaster of type
* {@link org.springframework.context.event.SimpleApplicationEventMulticaster} will be used.
*
* <p>Implements resource loading
through
extending
* <p>Implements resource loading
by
extending
* {@link org.springframework.core.io.DefaultResourceLoader}.
* Consequently treats non-URL resource paths as class path resources
* (supporting full class path resource names that include the package path,
* e.g. "mypackage/myresource.dat"), unless the {@link #getResourceByPath}
* method is over
writt
en in a subclass.
* method is over
ridd
en in a subclass.
*
* @author Rod Johnson
* @author Juergen Hoeller
...
...
@@ -390,7 +390,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
else
{
applicationEvent
=
new
PayloadApplicationEvent
<>(
this
,
event
);
if
(
eventType
==
null
)
{
eventType
=
((
PayloadApplicationEvent
)
applicationEvent
).
getResolvableType
();
eventType
=
((
PayloadApplicationEvent
<?>
)
applicationEvent
).
getResolvableType
();
}
}
...
...
@@ -713,7 +713,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
}
/**
* Instantiate and
invoke all registered
BeanPostProcessor beans,
* Instantiate and
register all
BeanPostProcessor beans,
* respecting explicit order if given.
* <p>Must be called before any instantiation of application beans.
*/
...
...
spring-core/src/main/java/org/springframework/util/ObjectUtils.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -639,7 +639,7 @@ public abstract class ObjectUtils {
/**
* Determine the class name for the given object.
* <p>Returns
{@code "null"}
if {@code obj} is {@code null}.
* <p>Returns
a {@code "null"} String
if {@code obj} is {@code null}.
* @param obj the object to introspect (may be {@code null})
* @return the corresponding class name
*/
...
...
@@ -650,7 +650,7 @@ public abstract class ObjectUtils {
/**
* Return a String representation of the specified Object.
* <p>Builds a String representation of the contents in case of an array.
* Returns
{@code "null"}
if {@code obj} is {@code null}.
* Returns
a {@code "null"} String
if {@code obj} is {@code null}.
* @param obj the object to build a String representation for
* @return a String representation of {@code obj}
*/
...
...
@@ -696,8 +696,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -727,8 +727,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -759,8 +759,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -790,8 +790,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -821,8 +821,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -853,8 +853,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -885,8 +885,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -916,8 +916,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
@@ -947,8 +947,8 @@ public abstract class ObjectUtils {
* Return a String representation of the contents of the specified array.
* <p>The String representation consists of a list of the array's elements,
* enclosed in curly braces ({@code "{}"}). Adjacent elements are separated
* by the characters {@code ", "} (a comma followed by a space).
Returns
*
{@code "null"}
if {@code array} is {@code null}.
* by the characters {@code ", "} (a comma followed by a space).
*
Returns a {@code "null"} String
if {@code array} is {@code null}.
* @param array the array to build a String representation for
* @return a String representation of {@code array}
*/
...
...
spring-jms/src/main/java/org/springframework/jms/config/MethodJmsListenerEndpoint.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -147,8 +147,11 @@ public class MethodJmsListenerEndpoint extends AbstractJmsListenerEndpoint imple
Assert
.
state
(
this
.
messageHandlerMethodFactory
!=
null
,
"Could not create message listener - MessageHandlerMethodFactory not set"
);
MessagingMessageListenerAdapter
messageListener
=
createMessageListenerInstance
();
Object
bean
=
getBean
();
Method
method
=
getMethod
();
Assert
.
state
(
bean
!=
null
&&
method
!=
null
,
"No bean+method set on endpoint"
);
InvocableHandlerMethod
invocableHandlerMethod
=
this
.
messageHandlerMethodFactory
.
createInvocableHandlerMethod
(
getBean
(),
getMethod
()
);
this
.
messageHandlerMethodFactory
.
createInvocableHandlerMethod
(
bean
,
method
);
messageListener
.
setHandlerMethod
(
invocableHandlerMethod
);
String
responseDestination
=
getDefaultResponseDestination
();
if
(
StringUtils
.
hasText
(
responseDestination
))
{
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MethodArgumentNotValidException.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -34,6 +34,7 @@ import org.springframework.validation.ObjectError;
@SuppressWarnings
(
"serial"
)
public
class
MethodArgumentNotValidException
extends
MethodArgumentResolutionException
{
@Nullable
private
final
BindingResult
bindingResult
;
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractMessageBrokerConfiguration.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -67,18 +67,20 @@ import org.springframework.validation.Validator;
* protocols such as STOMP.
*
* <p>{@link #clientInboundChannel()} and {@link #clientOutboundChannel()} deliver
* messages to and from remote clients to several message handlers such as
* messages to and from remote clients to several message handlers such as the
* following.
* <ul>
* <li>{@link #simpAnnotationMethodMessageHandler()}</li>
* <li>{@link #simpleBrokerMessageHandler()}</li>
* <li>{@link #stompBrokerRelayMessageHandler()}</li>
* <li>{@link #userDestinationMessageHandler()}</li>
* </ul>
* while {@link #brokerChannel()} delivers messages from within the application to the
*
* <p>{@link #brokerChannel()} delivers messages from within the application to the
* the respective message handlers. {@link #brokerMessagingTemplate()} can be injected
* into any application component to send messages.
*
* <p>Subclasses are responsible for the part of the configuration that feed messages
* <p>Subclasses are responsible for the part
s
of the configuration that feed messages
* to and from the client inbound/outbound channels (e.g. STOMP over WebSocket).
*
* @author Rossen Stoyanchev
...
...
@@ -403,7 +405,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
* Override this method to add custom message converters.
* @param messageConverters the list to add converters to, initially empty
* @return {@code true} if default message converters should be added to list,
* {@code false} if no more converters should be added
.
* {@code false} if no more converters should be added
*/
protected
boolean
configureMessageConverters
(
List
<
MessageConverter
>
messageConverters
)
{
return
true
;
...
...
@@ -448,9 +450,8 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
protected
abstract
SimpUserRegistry
createLocalUserRegistry
(
@Nullable
Integer
order
);
/**
* Return a {@link org.springframework.validation.Validator
* org.springframework.validation.Validators} instance for validating
* {@code @Payload} method arguments.
* Return an {@link org.springframework.validation.Validator} instance for
* validating {@code @Payload} method arguments.
* <p>In order, this method tries to get a Validator instance:
* <ul>
* <li>delegating to getValidator() first</li>
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompDecoder.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -267,7 +267,7 @@ public class StompDecoder {
if
(
index
+
1
>=
inString
.
length
())
{
throw
new
StompConversionException
(
"Illegal escape sequence at index "
+
index
+
": "
+
inString
);
}
Characte
r
c
=
inString
.
charAt
(
index
+
1
);
cha
r
c
=
inString
.
charAt
(
index
+
1
);
if
(
c
==
'r'
)
{
sb
.
append
(
'\r'
);
}
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -64,7 +64,7 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
* Create an instance wrapping the local user registry.
*/
public
MultiServerUserRegistry
(
SimpUserRegistry
localRegistry
)
{
Assert
.
notNull
(
localRegistry
,
"'localRegistry' is required
.
"
);
Assert
.
notNull
(
localRegistry
,
"'localRegistry' is required"
);
this
.
id
=
generateId
();
this
.
localRegistry
=
localRegistry
;
this
.
delegateApplicationEvents
=
this
.
localRegistry
instanceof
SmartApplicationListener
;
...
...
spring-test/src/main/java/org/springframework/test/context/TestContext.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -38,6 +38,8 @@ import org.springframework.test.annotation.DirtiesContext.HierarchyMode;
*
* @author Sam Brannen
* @since 2.5
* @see TestContextManager
* @see TestExecutionListener
*/
public
interface
TestContext
extends
AttributeAccessor
,
Serializable
{
...
...
@@ -47,7 +49,7 @@ public interface TestContext extends AttributeAccessor, Serializable {
* <p>Implementations of this method are responsible for loading the
* application context if the corresponding context has not already been
* loaded, potentially caching the context as well.
* @return the application context
* @return the application context
(never {@code null})
* @throws IllegalStateException if an error occurs while retrieving the
* application context
*/
...
...
@@ -62,7 +64,7 @@ public interface TestContext extends AttributeAccessor, Serializable {
/**
* Get the current {@linkplain Object test instance} for this test context.
* <p>Note: this is a mutable property.
* @return the current test instance (
may be
{@code null})
* @return the current test instance (
never
{@code null})
* @see #updateState(Object, Method, Throwable)
*/
Object
getTestInstance
();
...
...
@@ -70,7 +72,7 @@ public interface TestContext extends AttributeAccessor, Serializable {
/**
* Get the current {@linkplain Method test method} for this test context.
* <p>Note: this is a mutable property.
* @return the current test method
* @return the current test method
(never {@code null})
* @see #updateState(Object, Method, Throwable)
*/
Method
getTestMethod
();
...
...
spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultMockServerSpec.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.test.web.reactive.server
;
import
org.springframework.util.Assert
;
...
...
@@ -32,7 +33,7 @@ class DefaultMockServerSpec extends AbstractMockServerSpec<DefaultMockServerSpec
DefaultMockServerSpec
(
WebHandler
webHandler
)
{
Assert
.
notNull
(
webHandler
,
"
'WebHandler'
is required"
);
Assert
.
notNull
(
webHandler
,
"
WebHandler
is required"
);
this
.
webHandler
=
webHandler
;
}
...
...
spring-test/src/main/java/org/springframework/test/web/reactive/server/MockServerConfigurer.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.test.web.reactive.server
;
import
org.springframework.web.server.adapter.WebHttpHandlerBuilder
;
...
...
@@ -51,7 +52,7 @@ public interface MockServerConfigurer {
/**
* Invoked just before the mock server is built. Use this hook to inspect
* and/or modify application-declared filte
s and exception handlers,
* and/or modify application-declared filte
rs and exception handlers.
* @param builder the builder for the {@code HttpHandler} that will handle
* requests (i.e. the mock server)
*/
...
...
spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClientConfigurer.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.springframework.test.web.reactive.server
;
import
org.springframework.http.client.reactive.ClientHttpConnector
;
...
...
spring-test/src/main/java/org/springframework/test/web/reactive/server/XpathAssertions.java
浏览文件 @
6c87ef09
/*
* 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,7 +30,6 @@ import org.springframework.test.util.XpathExpectationsHelper;
import
org.springframework.util.Assert
;
import
org.springframework.util.MimeType
;
/**
* XPath assertions for the {@link WebTestClient}.
*
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/result/condition/AbstractRequestCondition.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -32,6 +32,30 @@ import org.springframework.lang.Nullable;
*/
public
abstract
class
AbstractRequestCondition
<
T
extends
AbstractRequestCondition
<
T
>>
implements
RequestCondition
<
T
>
{
/**
* Indicates whether this condition is empty, i.e. whether or not it
* contains any discrete items.
* @return {@code true} if empty; {@code false} otherwise
*/
public
boolean
isEmpty
()
{
return
getContent
().
isEmpty
();
}
/**
* Return the discrete items a request condition is composed of.
* <p>For example URL patterns, HTTP request methods, param expressions, etc.
* @return a collection of objects (never {@code null})
*/
protected
abstract
Collection
<?>
getContent
();
/**
* The notation to use when printing discrete items of content.
* <p>For example {@code " || "} for URL patterns or {@code " && "}
* for param expressions.
*/
protected
abstract
String
getToStringInfix
();
@Override
public
boolean
equals
(
@Nullable
Object
other
)
{
if
(
this
==
other
)
{
...
...
@@ -62,28 +86,4 @@ public abstract class AbstractRequestCondition<T extends AbstractRequestConditio
return
builder
.
toString
();
}
/**
* Indicates whether this condition is empty, i.e. whether or not it
* contains any discrete items.
* @return {@code true} if empty; {@code false} otherwise
*/
public
boolean
isEmpty
()
{
return
getContent
().
isEmpty
();
}
/**
* Return the discrete items a request condition is composed of.
* <p>For example URL patterns, HTTP request methods, param expressions, etc.
* @return a collection of objects, never {@code null}
*/
protected
abstract
Collection
<?>
getContent
();
/**
* The notation to use when printing discrete items of content.
* <p>For example {@code " || "} for URL patterns or {@code " && "}
* for param expressions.
*/
protected
abstract
String
getToStringInfix
();
}
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/AbstractRequestCondition.java
浏览文件 @
6c87ef09
/*
* 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.
...
...
@@ -44,7 +44,7 @@ public abstract class AbstractRequestCondition<T extends AbstractRequestConditio
/**
* Return the discrete items a request condition is composed of.
* <p>For example URL patterns, HTTP request methods, param expressions, etc.
* @return a collection of objects
, never {@code null}
* @return a collection of objects
(never {@code null})
*/
protected
abstract
Collection
<?>
getContent
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录