Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
fb7ae010
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 搜索 >>
提交
fb7ae010
编写于
9月 26, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid unnecessary generics on emptyMap/Set/List
上级
a6b0b6e2
变更
35
隐藏空白更改
内联
并排
Showing
35 changed file
with
69 addition
and
73 deletion
+69
-73
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
...springframework/cache/interceptor/CacheAspectSupport.java
+1
-1
spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java
...ngframework/scheduling/config/ScheduledTaskRegistrar.java
+4
-4
spring-core/src/main/java/org/springframework/core/Conventions.java
...e/src/main/java/org/springframework/core/Conventions.java
+3
-6
spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java
...ringframework/core/env/JOptCommandLinePropertySource.java
+2
-2
spring-core/src/main/java/org/springframework/util/InstanceFilter.java
...rc/main/java/org/springframework/util/InstanceFilter.java
+4
-6
spring-core/src/main/java/org/springframework/util/MimeType.java
...core/src/main/java/org/springframework/util/MimeType.java
+1
-1
spring-core/src/main/java/org/springframework/util/xml/SimpleNamespaceContext.java
.../org/springframework/util/xml/SimpleNamespaceContext.java
+1
-1
spring-expression/src/main/java/org/springframework/expression/spel/ExpressionState.java
.../org/springframework/expression/spel/ExpressionState.java
+1
-1
spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java
...essaging/handler/DestinationPatternsMessageCondition.java
+1
-1
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java
...k/messaging/simp/broker/AbstractBrokerMessageHandler.java
+3
-3
spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractBrokerRegistration.java
...ork/messaging/simp/config/AbstractBrokerRegistration.java
+4
-3
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
...ngframework/messaging/simp/stomp/StompHeaderAccessor.java
+2
-2
spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java
...k/messaging/simp/user/DefaultUserDestinationResolver.java
+1
-1
spring-messaging/src/main/java/org/springframework/messaging/support/NativeMessageHeaderAccessor.java
...mework/messaging/support/NativeMessageHeaderAccessor.java
+1
-1
spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/Reactor2TcpClient.java
...ingframework/messaging/tcp/reactor/Reactor2TcpClient.java
+1
-2
spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java
...java/org/springframework/mock/web/MockServletContext.java
+2
-2
spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java
...amework/test/context/support/TestPropertySourceUtils.java
+1
-1
spring-web/src/main/java/org/springframework/http/MediaType.java
...web/src/main/java/org/springframework/http/MediaType.java
+2
-2
spring-web/src/main/java/org/springframework/http/client/InterceptingAsyncClientHttpRequestFactory.java
...ttp/client/InterceptingAsyncClientHttpRequestFactory.java
+1
-1
spring-web/src/main/java/org/springframework/http/client/InterceptingClientHttpRequestFactory.java
...ork/http/client/InterceptingClientHttpRequestFactory.java
+2
-2
spring-web/src/main/java/org/springframework/web/accept/HeaderContentNegotiationStrategy.java
...ramework/web/accept/HeaderContentNegotiationStrategy.java
+1
-1
spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java
...ork/web/accept/MappingMediaTypeFileExtensionResolver.java
+1
-1
spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java
...org/springframework/web/filter/ForwardedHeaderFilter.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java
...ork/web/servlet/handler/AbstractHandlerMethodMapping.java
+2
-2
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java
...ework/web/servlet/handler/SimpleServletPostProcessor.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java
...k/web/servlet/mvc/condition/PatternsRequestCondition.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/RequestMethodsRequestCondition.java
...servlet/mvc/condition/RequestMethodsRequestCondition.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletModelAttributeMethodProcessor.java
...thod/annotation/ServletModelAttributeMethodProcessor.java
+2
-2
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java
...amework/web/servlet/mvc/method/annotation/SseEmitter.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java
...framework/web/servlet/view/freemarker/FreeMarkerView.java
+1
-1
spring-websocket/src/main/java/org/springframework/web/socket/client/AbstractWebSocketClient.java
...gframework/web/socket/client/AbstractWebSocketClient.java
+14
-13
spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java
...gframework/web/socket/messaging/WebSocketStompClient.java
+1
-1
spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java
...ocket/server/standard/UndertowRequestUpgradeStrategy.java
+1
-1
spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractHandshakeHandler.java
...k/web/socket/server/support/AbstractHandshakeHandler.java
+1
-1
spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeInterceptorChain.java
.../web/socket/server/support/HandshakeInterceptorChain.java
+2
-2
未找到文件。
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
浏览文件 @
fb7ae010
...
...
@@ -555,7 +555,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
public
Collection
<
CacheOperationContext
>
get
(
Class
<?
extends
CacheOperation
>
operationClass
)
{
Collection
<
CacheOperationContext
>
result
=
this
.
contexts
.
get
(
operationClass
);
return
(
result
!=
null
?
result
:
Collections
.
<
CacheOperationContext
>
emptyList
());
return
(
result
!=
null
?
result
:
Collections
.
emptyList
());
}
public
boolean
isSynchronized
()
{
...
...
spring-context/src/main/java/org/springframework/scheduling/config/ScheduledTaskRegistrar.java
浏览文件 @
fb7ae010
...
...
@@ -134,7 +134,7 @@ public class ScheduledTaskRegistrar implements InitializingBean, DisposableBean
*/
public
List
<
TriggerTask
>
getTriggerTaskList
()
{
return
(
this
.
triggerTasks
!=
null
?
Collections
.
unmodifiableList
(
this
.
triggerTasks
)
:
Collections
.
<
TriggerTask
>
emptyList
());
Collections
.
emptyList
());
}
/**
...
...
@@ -165,7 +165,7 @@ public class ScheduledTaskRegistrar implements InitializingBean, DisposableBean
*/
public
List
<
CronTask
>
getCronTaskList
()
{
return
(
this
.
cronTasks
!=
null
?
Collections
.
unmodifiableList
(
this
.
cronTasks
)
:
Collections
.
<
CronTask
>
emptyList
());
Collections
.
emptyList
());
}
/**
...
...
@@ -196,7 +196,7 @@ public class ScheduledTaskRegistrar implements InitializingBean, DisposableBean
*/
public
List
<
IntervalTask
>
getFixedRateTaskList
()
{
return
(
this
.
fixedRateTasks
!=
null
?
Collections
.
unmodifiableList
(
this
.
fixedRateTasks
)
:
Collections
.
<
IntervalTask
>
emptyList
());
Collections
.
emptyList
());
}
/**
...
...
@@ -227,7 +227,7 @@ public class ScheduledTaskRegistrar implements InitializingBean, DisposableBean
*/
public
List
<
IntervalTask
>
getFixedDelayTaskList
()
{
return
(
this
.
fixedDelayTasks
!=
null
?
Collections
.
unmodifiableList
(
this
.
fixedDelayTasks
)
:
Collections
.
<
IntervalTask
>
emptyList
());
Collections
.
emptyList
());
}
...
...
spring-core/src/main/java/org/springframework/core/Conventions.java
浏览文件 @
fb7ae010
...
...
@@ -50,13 +50,10 @@ public abstract class Conventions {
* when searching for the 'primary' interface of a proxy.
*/
private
static
final
Set
<
Class
<?>>
IGNORED_INTERFACES
;
static
{
IGNORED_INTERFACES
=
Collections
.
unmodifiableSet
(
new
HashSet
<>(
Arrays
.<
Class
<?>>
asList
(
Serializable
.
class
,
Externalizable
.
class
,
Cloneable
.
class
,
Comparable
.
class
)));
IGNORED_INTERFACES
=
Collections
.
unmodifiableSet
(
new
HashSet
<>(
Arrays
.
asList
(
Serializable
.
class
,
Externalizable
.
class
,
Cloneable
.
class
,
Comparable
.
class
)));
}
...
...
spring-core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java
浏览文件 @
fb7ae010
...
...
@@ -101,7 +101,7 @@ public class JOptCommandLinePropertySource extends CommandLinePropertySource<Opt
stringArgValues
.
add
(
argValue
instanceof
String
?
(
String
)
argValue
:
argValue
.
toString
());
}
if
(
stringArgValues
.
isEmpty
())
{
return
(
this
.
source
.
has
(
name
)
?
Collections
.
<
String
>
emptyList
()
:
null
);
return
(
this
.
source
.
has
(
name
)
?
Collections
.
emptyList
()
:
null
);
}
return
Collections
.
unmodifiableList
(
stringArgValues
);
}
...
...
@@ -114,7 +114,7 @@ public class JOptCommandLinePropertySource extends CommandLinePropertySource<Opt
Assert
.
isInstanceOf
(
String
.
class
,
argValue
,
"Argument values must be of type String"
);
stringArgValues
.
add
((
String
)
argValue
);
}
return
(
stringArgValues
.
isEmpty
()
?
Collections
.
<
String
>
emptyList
()
:
return
(
stringArgValues
.
isEmpty
()
?
Collections
.
emptyList
()
:
Collections
.
unmodifiableList
(
stringArgValues
));
}
...
...
spring-core/src/main/java/org/springframework/util/InstanceFilter.java
浏览文件 @
fb7ae010
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -54,8 +54,8 @@ public class InstanceFilter<T> {
public
InstanceFilter
(
Collection
<?
extends
T
>
includes
,
Collection
<?
extends
T
>
excludes
,
boolean
matchIfEmpty
)
{
this
.
includes
=
includes
!=
null
?
includes
:
Collections
.<
T
>
emptyList
(
);
this
.
excludes
=
excludes
!=
null
?
excludes
:
Collections
.<
T
>
emptyList
(
);
this
.
includes
=
(
includes
!=
null
?
includes
:
Collections
.
emptyList
()
);
this
.
excludes
=
(
excludes
!=
null
?
excludes
:
Collections
.
emptyList
()
);
this
.
matchIfEmpty
=
matchIfEmpty
;
}
...
...
@@ -64,7 +64,7 @@ public class InstanceFilter<T> {
* Determine if the specified {code instance} matches this filter.
*/
public
boolean
match
(
T
instance
)
{
Assert
.
notNull
(
instance
,
"
The instance to match is mandatory
"
);
Assert
.
notNull
(
instance
,
"
Instance to match must not be null
"
);
boolean
includesSet
=
!
this
.
includes
.
isEmpty
();
boolean
excludesSet
=
!
this
.
excludes
.
isEmpty
();
...
...
@@ -74,11 +74,9 @@ public class InstanceFilter<T> {
boolean
matchIncludes
=
match
(
instance
,
this
.
includes
);
boolean
matchExcludes
=
match
(
instance
,
this
.
excludes
);
if
(!
includesSet
)
{
return
!
matchExcludes
;
}
if
(!
excludesSet
)
{
return
matchIncludes
;
}
...
...
spring-core/src/main/java/org/springframework/util/MimeType.java
浏览文件 @
fb7ae010
...
...
@@ -120,7 +120,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
* @throws IllegalArgumentException if any of the parameters contains illegal characters
*/
public
MimeType
(
String
type
,
String
subtype
)
{
this
(
type
,
subtype
,
Collections
.
<
String
,
String
>
emptyMap
());
this
(
type
,
subtype
,
Collections
.
emptyMap
());
}
/**
...
...
spring-core/src/main/java/org/springframework/util/xml/SimpleNamespaceContext.java
浏览文件 @
fb7ae010
...
...
@@ -87,7 +87,7 @@ public class SimpleNamespaceContext implements NamespaceContext {
}
else
{
Set
<
String
>
prefixes
=
this
.
namespaceUriToPrefixes
.
get
(
namespaceUri
);
return
(
prefixes
!=
null
?
Collections
.
unmodifiableSet
(
prefixes
)
:
Collections
.
<
String
>
emptySet
());
return
(
prefixes
!=
null
?
Collections
.
unmodifiableSet
(
prefixes
)
:
Collections
.
emptySet
());
}
}
...
...
spring-expression/src/main/java/org/springframework/expression/spel/ExpressionState.java
浏览文件 @
fb7ae010
...
...
@@ -183,7 +183,7 @@ public class ExpressionState {
public
void
enterScope
()
{
ensureVariableScopesInitialized
();
this
.
variableScopes
.
push
(
new
VariableScope
(
Collections
.
<
String
,
Object
>
emptyMap
()));
this
.
variableScopes
.
push
(
new
VariableScope
(
Collections
.
emptyMap
()));
this
.
scopeRootObjects
.
push
(
getActiveContextObject
());
}
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java
浏览文件 @
fb7ae010
...
...
@@ -73,7 +73,7 @@ public class DestinationPatternsMessageCondition extends AbstractMessageConditio
private
static
List
<
String
>
asList
(
String
...
patterns
)
{
return
(
patterns
!=
null
?
Arrays
.
asList
(
patterns
)
:
Collections
.
<
String
>
emptyList
());
return
(
patterns
!=
null
?
Arrays
.
asList
(
patterns
)
:
Collections
.
emptyList
());
}
private
static
Set
<
String
>
prependLeadingSlash
(
Collection
<
String
>
patterns
,
PathMatcher
pathMatcher
)
{
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java
浏览文件 @
fb7ae010
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -84,7 +84,7 @@ public abstract class AbstractBrokerMessageHandler
public
AbstractBrokerMessageHandler
(
SubscribableChannel
inboundChannel
,
MessageChannel
outboundChannel
,
SubscribableChannel
brokerChannel
)
{
this
(
inboundChannel
,
outboundChannel
,
brokerChannel
,
Collections
.
<
String
>
emptyList
());
this
(
inboundChannel
,
outboundChannel
,
brokerChannel
,
Collections
.
emptyList
());
}
/**
...
...
@@ -105,7 +105,7 @@ public abstract class AbstractBrokerMessageHandler
this
.
clientOutboundChannel
=
outboundChannel
;
this
.
brokerChannel
=
brokerChannel
;
destinationPrefixes
=
(
destinationPrefixes
!=
null
)
?
destinationPrefixes
:
Collections
.
<
String
>
emptyList
();
destinationPrefixes
=
(
destinationPrefixes
!=
null
)
?
destinationPrefixes
:
Collections
.
emptyList
();
this
.
destinationPrefixes
=
Collections
.
unmodifiableCollection
(
destinationPrefixes
);
}
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/config/AbstractBrokerRegistration.java
浏览文件 @
fb7ae010
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -50,8 +50,8 @@ public abstract class AbstractBrokerRegistration {
this
.
clientInboundChannel
=
clientInboundChannel
;
this
.
clientOutboundChannel
=
clientOutboundChannel
;
this
.
destinationPrefixes
=
(
destinationPrefixes
!=
null
)
?
Arrays
.<
String
>
asList
(
destinationPrefixes
)
:
Collections
.<
String
>
emptyList
(
);
this
.
destinationPrefixes
=
(
destinationPrefixes
!=
null
?
Arrays
.
asList
(
destinationPrefixes
)
:
Collections
.
emptyList
()
);
}
...
...
@@ -67,6 +67,7 @@ public abstract class AbstractBrokerRegistration {
return
this
.
destinationPrefixes
;
}
protected
abstract
AbstractBrokerMessageHandler
getMessageHandler
(
SubscribableChannel
brokerChannel
);
}
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
浏览文件 @
fb7ae010
...
...
@@ -182,7 +182,7 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
Map
<
String
,
List
<
String
>>
getNativeHeaders
()
{
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
List
<
String
>>
map
=
(
Map
<
String
,
List
<
String
>>)
getHeader
(
NATIVE_HEADERS
);
return
(
map
!=
null
?
map
:
Collections
.
<
String
,
List
<
String
>>
emptyMap
());
return
(
map
!=
null
?
map
:
Collections
.
emptyMap
());
}
public
StompCommand
updateStompCommandAsClientMessage
()
{
...
...
@@ -242,7 +242,7 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
public
Set
<
String
>
getAcceptVersion
()
{
String
rawValue
=
getFirstNativeHeader
(
STOMP_ACCEPT_VERSION_HEADER
);
return
(
rawValue
!=
null
?
StringUtils
.
commaDelimitedListToSet
(
rawValue
)
:
Collections
.
<
String
>
emptySet
());
return
(
rawValue
!=
null
?
StringUtils
.
commaDelimitedListToSet
(
rawValue
)
:
Collections
.
emptySet
());
}
public
void
setHost
(
String
host
)
{
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java
浏览文件 @
fb7ae010
...
...
@@ -188,7 +188,7 @@ public class DefaultUserDestinationResolver implements UserDestinationResolver {
}
}
else
{
sessionIds
=
Collections
.
<
String
>
emptySet
();
sessionIds
=
Collections
.
emptySet
();
}
}
if
(!
this
.
keepLeadingSlash
)
{
...
...
spring-messaging/src/main/java/org/springframework/messaging/support/NativeMessageHeaderAccessor.java
浏览文件 @
fb7ae010
...
...
@@ -94,7 +94,7 @@ public class NativeMessageHeaderAccessor extends MessageHeaderAccessor {
*/
public
Map
<
String
,
List
<
String
>>
toNativeHeaderMap
()
{
Map
<
String
,
List
<
String
>>
map
=
getNativeHeaders
();
return
(
map
!=
null
?
new
LinkedMultiValueMap
<>(
map
)
:
Collections
.
<
String
,
List
<
String
>>
emptyMap
());
return
(
map
!=
null
?
new
LinkedMultiValueMap
<>(
map
)
:
Collections
.
emptyMap
());
}
@Override
...
...
spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/Reactor2TcpClient.java
浏览文件 @
fb7ae010
...
...
@@ -299,8 +299,7 @@ public class Reactor2TcpClient<P> implements TcpOperations<P> {
@Override
public
ReactorConfiguration
read
()
{
return
new
ReactorConfiguration
(
Collections
.<
DispatcherConfiguration
>
emptyList
(),
"sync"
,
new
Properties
());
return
new
ReactorConfiguration
(
Collections
.
emptyList
(),
"sync"
,
new
Properties
());
}
}
...
...
spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java
浏览文件 @
fb7ae010
...
...
@@ -425,13 +425,13 @@ public class MockServletContext implements ServletContext {
@Override
@Deprecated
public
Enumeration
<
Servlet
>
getServlets
()
{
return
Collections
.
enumeration
(
Collections
.
<
Servlet
>
emptySet
());
return
Collections
.
enumeration
(
Collections
.
emptySet
());
}
@Override
@Deprecated
public
Enumeration
<
String
>
getServletNames
()
{
return
Collections
.
enumeration
(
Collections
.
<
String
>
emptySet
());
return
Collections
.
enumeration
(
Collections
.
emptySet
());
}
@Override
...
...
spring-test/src/main/java/org/springframework/test/context/support/TestPropertySourceUtils.java
浏览文件 @
fb7ae010
...
...
@@ -132,7 +132,7 @@ public abstract class TestPropertySourceUtils {
if
(
logger
.
isTraceEnabled
())
{
logger
.
trace
(
String
.
format
(
"Processing inlined properties for TestPropertySource attributes %s"
,
attrs
));
}
properties
.
addAll
(
0
,
Arrays
.
<
String
>
asList
(
attrs
.
getProperties
()));
properties
.
addAll
(
0
,
Arrays
.
asList
(
attrs
.
getProperties
()));
if
(!
attrs
.
isInheritProperties
())
{
break
;
}
...
...
spring-web/src/main/java/org/springframework/http/MediaType.java
浏览文件 @
fb7ae010
...
...
@@ -269,7 +269,7 @@ public class MediaType extends MimeType implements Serializable {
* @throws IllegalArgumentException if any of the parameters contain illegal characters
*/
public
MediaType
(
String
type
,
String
subtype
)
{
super
(
type
,
subtype
,
Collections
.
<
String
,
String
>
emptyMap
());
super
(
type
,
subtype
,
Collections
.
emptyMap
());
}
/**
...
...
@@ -463,7 +463,7 @@ public class MediaType extends MimeType implements Serializable {
*/
public
static
List
<
MediaType
>
parseMediaTypes
(
List
<
String
>
mediaTypes
)
{
if
(
CollectionUtils
.
isEmpty
(
mediaTypes
))
{
return
Collections
.
<
MediaType
>
emptyList
();
return
Collections
.
emptyList
();
}
else
if
(
mediaTypes
.
size
()
==
1
)
{
return
parseMediaTypes
(
mediaTypes
.
get
(
0
));
...
...
spring-web/src/main/java/org/springframework/http/client/InterceptingAsyncClientHttpRequestFactory.java
浏览文件 @
fb7ae010
...
...
@@ -47,7 +47,7 @@ public class InterceptingAsyncClientHttpRequestFactory implements AsyncClientHtt
List
<
AsyncClientHttpRequestInterceptor
>
interceptors
)
{
this
.
delegate
=
delegate
;
this
.
interceptors
=
(
interceptors
!=
null
?
interceptors
:
Collections
.
<
AsyncClientHttpRequestInterceptor
>
emptyList
());
this
.
interceptors
=
(
interceptors
!=
null
?
interceptors
:
Collections
.
emptyList
());
}
...
...
spring-web/src/main/java/org/springframework/http/client/InterceptingClientHttpRequestFactory.java
浏览文件 @
fb7ae010
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
6
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,7 +42,7 @@ public class InterceptingClientHttpRequestFactory extends AbstractClientHttpRequ
List
<
ClientHttpRequestInterceptor
>
interceptors
)
{
super
(
requestFactory
);
this
.
interceptors
=
(
interceptors
!=
null
?
interceptors
:
Collections
.
<
ClientHttpRequestInterceptor
>
emptyList
());
this
.
interceptors
=
(
interceptors
!=
null
?
interceptors
:
Collections
.
emptyList
());
}
@Override
...
...
spring-web/src/main/java/org/springframework/web/accept/HeaderContentNegotiationStrategy.java
浏览文件 @
fb7ae010
...
...
@@ -45,7 +45,7 @@ public class HeaderContentNegotiationStrategy implements ContentNegotiationStrat
String
[]
headerValueArray
=
request
.
getHeaderValues
(
HttpHeaders
.
ACCEPT
);
if
(
headerValueArray
==
null
)
{
return
Collections
.
<
MediaType
>
emptyList
();
return
Collections
.
emptyList
();
}
List
<
String
>
headerValues
=
Arrays
.
asList
(
headerValueArray
);
...
...
spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java
浏览文件 @
fb7ae010
...
...
@@ -90,7 +90,7 @@ public class MappingMediaTypeFileExtensionResolver implements MediaTypeFileExten
@Override
public
List
<
String
>
resolveFileExtensions
(
MediaType
mediaType
)
{
List
<
String
>
fileExtensions
=
this
.
fileExtensions
.
get
(
mediaType
);
return
(
fileExtensions
!=
null
)
?
fileExtensions
:
Collections
.
<
String
>
emptyList
();
return
(
fileExtensions
!=
null
)
?
fileExtensions
:
Collections
.
emptyList
();
}
@Override
...
...
spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java
浏览文件 @
fb7ae010
...
...
@@ -213,7 +213,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
@Override
public
Enumeration
<
String
>
getHeaders
(
String
name
)
{
List
<
String
>
value
=
this
.
headers
.
get
(
name
);
return
(
Collections
.
enumeration
(
value
!=
null
?
value
:
Collections
.
<
String
>
emptySet
()));
return
(
Collections
.
enumeration
(
value
!=
null
?
value
:
Collections
.
emptySet
()));
}
@Override
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java
浏览文件 @
fb7ae010
...
...
@@ -590,7 +590,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
private
void
addMappingName
(
String
name
,
HandlerMethod
handlerMethod
)
{
List
<
HandlerMethod
>
oldList
=
this
.
nameLookup
.
get
(
name
);
if
(
oldList
==
null
)
{
oldList
=
Collections
.
<
HandlerMethod
>
emptyList
();
oldList
=
Collections
.
emptyList
();
}
for
(
HandlerMethod
current
:
oldList
)
{
...
...
@@ -685,7 +685,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
Assert
.
notNull
(
handlerMethod
);
this
.
mapping
=
mapping
;
this
.
handlerMethod
=
handlerMethod
;
this
.
directUrls
=
(
directUrls
!=
null
?
directUrls
:
Collections
.
<
String
>
emptyList
());
this
.
directUrls
=
(
directUrls
!=
null
?
directUrls
:
Collections
.
emptyList
());
this
.
mappingName
=
mappingName
;
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java
浏览文件 @
fb7ae010
...
...
@@ -163,7 +163,7 @@ public class SimpleServletPostProcessor implements
@Override
public
Enumeration
<
String
>
getInitParameterNames
()
{
return
Collections
.
enumeration
(
Collections
.
<
String
>
emptySet
());
return
Collections
.
enumeration
(
Collections
.
emptySet
());
}
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java
浏览文件 @
fb7ae010
...
...
@@ -119,7 +119,7 @@ public final class PatternsRequestCondition extends AbstractRequestCondition<Pat
private
static
List
<
String
>
asList
(
String
...
patterns
)
{
return
(
patterns
!=
null
?
Arrays
.
asList
(
patterns
)
:
Collections
.
<
String
>
emptyList
());
return
(
patterns
!=
null
?
Arrays
.
asList
(
patterns
)
:
Collections
.
emptyList
());
}
private
static
Set
<
String
>
prependLeadingSlash
(
Collection
<
String
>
patterns
)
{
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/RequestMethodsRequestCondition.java
浏览文件 @
fb7ae010
...
...
@@ -62,7 +62,7 @@ public final class RequestMethodsRequestCondition extends AbstractRequestConditi
private
static
List
<
RequestMethod
>
asList
(
RequestMethod
...
requestMethods
)
{
return
(
requestMethods
!=
null
?
Arrays
.
asList
(
requestMethods
)
:
Collections
.
<
RequestMethod
>
emptyList
());
return
(
requestMethods
!=
null
?
Arrays
.
asList
(
requestMethods
)
:
Collections
.
emptyList
());
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletModelAttributeMethodProcessor.java
浏览文件 @
fb7ae010
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -106,7 +106,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
protected
final
Map
<
String
,
String
>
getUriTemplateVariables
(
NativeWebRequest
request
)
{
Map
<
String
,
String
>
variables
=
(
Map
<
String
,
String
>)
request
.
getAttribute
(
HandlerMapping
.
URI_TEMPLATE_VARIABLES_ATTRIBUTE
,
RequestAttributes
.
SCOPE_REQUEST
);
return
(
variables
!=
null
?
variables
:
Collections
.
<
String
,
String
>
emptyMap
());
return
(
variables
!=
null
?
variables
:
Collections
.
emptyMap
());
}
/**
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java
浏览文件 @
fb7ae010
...
...
@@ -235,7 +235,7 @@ public class SseEmitter extends ResponseBodyEmitter {
@Override
public
Set
<
DataWithMediaType
>
build
()
{
if
((
this
.
sb
==
null
||
this
.
sb
.
length
()
==
0
)
&&
this
.
dataToSend
.
isEmpty
())
{
return
Collections
.
<
DataWithMediaType
>
emptySet
();
return
Collections
.
emptySet
();
}
append
(
"\n"
);
saveAppendedText
();
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/freemarker/FreeMarkerView.java
浏览文件 @
fb7ae010
...
...
@@ -405,7 +405,7 @@ public class FreeMarkerView extends AbstractTemplateView {
@Override
public
Enumeration
<
String
>
getInitParameterNames
()
{
return
Collections
.
enumeration
(
Collections
.
<
String
>
emptySet
());
return
Collections
.
enumeration
(
Collections
.
emptySet
());
}
}
...
...
spring-websocket/src/main/java/org/springframework/web/socket/client/AbstractWebSocketClient.java
浏览文件 @
fb7ae010
...
...
@@ -43,8 +43,6 @@ import org.springframework.web.util.UriComponentsBuilder;
*/
public
abstract
class
AbstractWebSocketClient
implements
WebSocketClient
{
protected
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
private
static
final
Set
<
String
>
specialHeaders
=
new
HashSet
<>();
static
{
...
...
@@ -60,11 +58,14 @@ public abstract class AbstractWebSocketClient implements WebSocketClient {
}
protected
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
@Override
public
ListenableFuture
<
WebSocketSession
>
doHandshake
(
WebSocketHandler
webSocketHandler
,
String
uriTemplate
,
Object
...
uriVars
)
{
Assert
.
notNull
(
uriTemplate
,
"
uriTemplate
must not be null"
);
Assert
.
notNull
(
uriTemplate
,
"
'uriTemplate'
must not be null"
);
URI
uri
=
UriComponentsBuilder
.
fromUriString
(
uriTemplate
).
buildAndExpand
(
uriVars
).
encode
().
toUri
();
return
doHandshake
(
webSocketHandler
,
null
,
uri
);
}
...
...
@@ -73,7 +74,7 @@ public abstract class AbstractWebSocketClient implements WebSocketClient {
public
final
ListenableFuture
<
WebSocketSession
>
doHandshake
(
WebSocketHandler
webSocketHandler
,
WebSocketHttpHeaders
headers
,
URI
uri
)
{
Assert
.
notNull
(
webSocketHandler
,
"
w
ebSocketHandler must not be null"
);
Assert
.
notNull
(
webSocketHandler
,
"
W
ebSocketHandler must not be null"
);
assertUri
(
uri
);
if
(
logger
.
isDebugEnabled
())
{
...
...
@@ -89,25 +90,26 @@ public abstract class AbstractWebSocketClient implements WebSocketClient {
}
}
List
<
String
>
subProtocols
=
(
(
headers
!=
null
)
&&
(
headers
.
getSecWebSocketProtocol
()
!=
null
))
?
headers
.
getSecWebSocketProtocol
()
:
Collections
.
<
String
>
emptyList
(
);
List
<
String
>
subProtocols
=
(
headers
!=
null
&&
headers
.
getSecWebSocketProtocol
()
!=
null
?
headers
.
getSecWebSocketProtocol
()
:
Collections
.
emptyList
()
);
List
<
WebSocketExtension
>
extensions
=
(
(
headers
!=
null
)
&&
(
headers
.
getSecWebSocketExtensions
()
!=
null
))
?
headers
.
getSecWebSocketExtensions
()
:
Collections
.
<
WebSocketExtension
>
emptyList
(
);
List
<
WebSocketExtension
>
extensions
=
(
headers
!=
null
&&
headers
.
getSecWebSocketExtensions
()
!=
null
?
headers
.
getSecWebSocketExtensions
()
:
Collections
.
emptyList
()
);
return
doHandshakeInternal
(
webSocketHandler
,
headersToUse
,
uri
,
subProtocols
,
extensions
,
Collections
.
<
String
,
Object
>
emptyMap
());
Collections
.
emptyMap
());
}
protected
void
assertUri
(
URI
uri
)
{
Assert
.
notNull
(
uri
,
"
uri
must not be null"
);
Assert
.
notNull
(
uri
,
"
URI
must not be null"
);
String
scheme
=
uri
.
getScheme
();
Assert
.
isTrue
(
scheme
!=
null
&&
(
"ws"
.
equals
(
scheme
)
||
"wss"
.
equals
(
scheme
)),
"Invalid scheme: "
+
scheme
);
if
(!
"ws"
.
equals
(
scheme
)
&&
!
"wss"
.
equals
(
scheme
))
{
throw
new
IllegalArgumentException
(
"Invalid scheme: "
+
scheme
);
}
}
/**
* Perform the actual handshake to establish a connection to the server.
*
* @param webSocketHandler the client-side handler for WebSocket messages
* @param headers HTTP headers to use for the handshake, with unwanted (forbidden)
* headers filtered out, never {@code null}
...
...
@@ -116,7 +118,6 @@ public abstract class AbstractWebSocketClient implements WebSocketClient {
* @param extensions requested WebSocket extensions, or an empty list
* @param attributes attributes to associate with the WebSocketSession, i.e. via
* {@link WebSocketSession#getAttributes()}; currently always an empty map.
*
* @return the established WebSocket session wrapped in a ListenableFuture.
*/
protected
abstract
ListenableFuture
<
WebSocketSession
>
doHandshakeInternal
(
WebSocketHandler
webSocketHandler
,
...
...
spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketStompClient.java
浏览文件 @
fb7ae010
...
...
@@ -468,7 +468,7 @@ public class WebSocketStompClient extends StompClientSupport implements SmartLif
}
public
List
<
Message
<
byte
[]>>
decode
(
WebSocketMessage
<?>
webSocketMessage
)
{
List
<
Message
<
byte
[]>>
result
=
Collections
.
<
Message
<
byte
[]>>
emptyList
();
List
<
Message
<
byte
[]>>
result
=
Collections
.
emptyList
();
ByteBuffer
byteBuffer
;
if
(
webSocketMessage
instanceof
TextMessage
)
{
byteBuffer
=
ByteBuffer
.
wrap
(((
TextMessage
)
webSocketMessage
).
asBytes
());
...
...
spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java
浏览文件 @
fb7ae010
...
...
@@ -66,7 +66,7 @@ public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrat
StringBuffer
requestUrl
=
servletRequest
.
getRequestURL
();
String
path
=
servletRequest
.
getRequestURI
();
// shouldn't matter
Map
<
String
,
String
>
pathParams
=
Collections
.
<
String
,
String
>
emptyMap
();
Map
<
String
,
String
>
pathParams
=
Collections
.
emptyMap
();
ServerEndpointRegistration
endpointConfig
=
new
ServerEndpointRegistration
(
path
,
endpoint
);
endpointConfig
.
setSubprotocols
(
Collections
.
singletonList
(
selectedProtocol
));
...
...
spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractHandshakeHandler.java
浏览文件 @
fb7ae010
...
...
@@ -367,7 +367,7 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
if
(
handlerToCheck
instanceof
SubProtocolCapable
)
{
subProtocols
=
((
SubProtocolCapable
)
handlerToCheck
).
getSubProtocols
();
}
return
(
subProtocols
!=
null
?
subProtocols
:
Collections
.
<
String
>
emptyList
());
return
(
subProtocols
!=
null
?
subProtocols
:
Collections
.
emptyList
());
}
/**
...
...
spring-websocket/src/main/java/org/springframework/web/socket/server/support/HandshakeInterceptorChain.java
浏览文件 @
fb7ae010
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
6
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.
...
...
@@ -46,7 +46,7 @@ public class HandshakeInterceptorChain {
public
HandshakeInterceptorChain
(
List
<
HandshakeInterceptor
>
interceptors
,
WebSocketHandler
wsHandler
)
{
this
.
interceptors
=
(
interceptors
!=
null
?
interceptors
:
Collections
.
<
HandshakeInterceptor
>
emptyList
());
this
.
interceptors
=
(
interceptors
!=
null
?
interceptors
:
Collections
.
emptyList
());
this
.
wsHandler
=
wsHandler
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录