Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
9ca8681f
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,发现更多精彩内容 >>
提交
9ca8681f
编写于
5月 13, 2019
作者:
S
stsypanov
提交者:
Juergen Hoeller
5月 13, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Iteration over a map using EntrySet
上级
785e8d81
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
45 addition
and
36 deletion
+45
-36
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractMethodMessageHandler.java
...ging/handler/invocation/AbstractMethodMessageHandler.java
+3
-2
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/reactive/InvocableHelper.java
...essaging/handler/invocation/reactive/InvocableHelper.java
+3
-2
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
...in/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
+4
-4
spring-test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java
.../java/org/springframework/mock/web/HeaderValueHolder.java
+3
-3
spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java
...st/web/servlet/request/MockHttpServletRequestBuilder.java
+15
-10
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java
...ve/result/method/annotation/ControllerMethodResolver.java
+3
-2
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java
...pringframework/web/servlet/mvc/WebContentInterceptor.java
+6
-6
spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractFlashMapManager.java
...ramework/web/servlet/support/AbstractFlashMapManager.java
+4
-3
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java
...amework/web/servlet/tags/form/AbstractHtmlElementTag.java
+2
-2
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
...va/org/springframework/web/servlet/tags/form/FormTag.java
+2
-2
未找到文件。
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractMethodMessageHandler.java
浏览文件 @
9ca8681f
...
...
@@ -640,9 +640,10 @@ public abstract class AbstractMethodMessageHandler<T>
if
(
method
!=
null
)
{
return
new
InvocableHandlerMethod
(
handlerMethod
.
getBean
(),
method
);
}
for
(
MessagingAdviceBean
advice
:
this
.
exceptionHandlerAdviceCache
.
keySet
())
{
for
(
Map
.
Entry
<
MessagingAdviceBean
,
AbstractExceptionHandlerMethodResolver
>
entry
:
this
.
exceptionHandlerAdviceCache
.
entrySet
())
{
MessagingAdviceBean
advice
=
entry
.
getKey
();
if
(
advice
.
isApplicableToBeanType
(
beanType
))
{
resolver
=
this
.
exceptionHandlerAdviceCache
.
get
(
advice
);
resolver
=
entry
.
getValue
(
);
method
=
resolver
.
resolveMethod
(
exception
);
if
(
method
!=
null
)
{
return
new
InvocableHandlerMethod
(
advice
.
resolveBean
(),
method
);
...
...
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/reactive/InvocableHelper.java
浏览文件 @
9ca8681f
...
...
@@ -155,9 +155,10 @@ class InvocableHelper {
exceptionHandlerMethod
=
new
InvocableHandlerMethod
(
handlerMethod
.
getBean
(),
method
);
}
else
{
for
(
MessagingAdviceBean
advice
:
this
.
exceptionHandlerAdviceCache
.
keySet
())
{
for
(
Map
.
Entry
<
MessagingAdviceBean
,
AbstractExceptionHandlerMethodResolver
>
entry
:
this
.
exceptionHandlerAdviceCache
.
entrySet
())
{
MessagingAdviceBean
advice
=
entry
.
getKey
();
if
(
advice
.
isApplicableToBeanType
(
beanType
))
{
resolver
=
this
.
exceptionHandlerAdviceCache
.
get
(
advice
);
resolver
=
entry
.
getValue
(
);
method
=
resolver
.
resolveMethod
(
ex
);
if
(
method
!=
null
)
{
exceptionHandlerMethod
=
new
InvocableHandlerMethod
(
advice
.
resolveBean
(),
method
);
...
...
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
浏览文件 @
9ca8681f
...
...
@@ -759,8 +759,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
*/
protected
void
initJaxbMarshaller
(
Marshaller
marshaller
)
throws
JAXBException
{
if
(
this
.
marshallerProperties
!=
null
)
{
for
(
String
name
:
this
.
marshallerProperties
.
ke
ySet
())
{
marshaller
.
setProperty
(
name
,
this
.
marshallerProperties
.
get
(
name
));
for
(
Map
.
Entry
<
String
,
?>
entry
:
this
.
marshallerProperties
.
entr
ySet
())
{
marshaller
.
setProperty
(
entry
.
getKey
(),
entry
.
getValue
(
));
}
}
if
(
this
.
marshallerListener
!=
null
)
{
...
...
@@ -913,8 +913,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
*/
protected
void
initJaxbUnmarshaller
(
Unmarshaller
unmarshaller
)
throws
JAXBException
{
if
(
this
.
unmarshallerProperties
!=
null
)
{
for
(
String
name
:
this
.
unmarshallerProperties
.
ke
ySet
())
{
unmarshaller
.
setProperty
(
name
,
this
.
unmarshallerProperties
.
get
(
name
));
for
(
Map
.
Entry
<
String
,
?>
entry
:
this
.
unmarshallerProperties
.
entr
ySet
())
{
unmarshaller
.
setProperty
(
entry
.
getKey
(),
entry
.
getValue
(
));
}
}
if
(
this
.
unmarshallerListener
!=
null
)
{
...
...
spring-test/src/main/java/org/springframework/mock/web/HeaderValueHolder.java
浏览文件 @
9ca8681f
...
...
@@ -95,9 +95,9 @@ class HeaderValueHolder {
@Nullable
public
static
HeaderValueHolder
getByName
(
Map
<
String
,
HeaderValueHolder
>
headers
,
String
name
)
{
Assert
.
notNull
(
name
,
"Header name must not be null"
);
for
(
String
headerName
:
headers
.
ke
ySet
())
{
if
(
headerName
.
equalsIgnoreCase
(
name
))
{
return
headers
.
get
(
headerName
);
for
(
Map
.
Entry
<
String
,
HeaderValueHolder
>
entry
:
headers
.
entr
ySet
())
{
if
(
entry
.
getKey
()
.
equalsIgnoreCase
(
name
))
{
return
entry
.
getValue
(
);
}
}
return
null
;
...
...
spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java
浏览文件 @
9ca8681f
...
...
@@ -530,14 +530,16 @@ public class MockHttpServletRequestBuilder
this
.
contentType
=
parentBuilder
.
contentType
;
}
for
(
String
headerName
:
parentBuilder
.
headers
.
keySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
Object
>>
entry
:
parentBuilder
.
headers
.
entrySet
())
{
String
headerName
=
entry
.
getKey
();
if
(!
this
.
headers
.
containsKey
(
headerName
))
{
this
.
headers
.
put
(
headerName
,
parentBuilder
.
headers
.
get
(
headerName
));
this
.
headers
.
put
(
headerName
,
entry
.
getValue
(
));
}
}
for
(
String
paramName
:
parentBuilder
.
parameters
.
keySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
parentBuilder
.
parameters
.
entrySet
())
{
String
paramName
=
entry
.
getKey
();
if
(!
this
.
parameters
.
containsKey
(
paramName
))
{
this
.
parameters
.
put
(
paramName
,
parentBuilder
.
parameters
.
get
(
paramName
));
this
.
parameters
.
put
(
paramName
,
entry
.
getValue
(
));
}
}
for
(
Cookie
cookie
:
parentBuilder
.
cookies
)
{
...
...
@@ -551,19 +553,22 @@ public class MockHttpServletRequestBuilder
}
}
for
(
String
attributeName
:
parentBuilder
.
requestAttributes
.
keySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
parentBuilder
.
requestAttributes
.
entrySet
())
{
String
attributeName
=
entry
.
getKey
();
if
(!
this
.
requestAttributes
.
containsKey
(
attributeName
))
{
this
.
requestAttributes
.
put
(
attributeName
,
parentBuilder
.
requestAttributes
.
get
(
attributeName
));
this
.
requestAttributes
.
put
(
attributeName
,
entry
.
getValue
(
));
}
}
for
(
String
attributeName
:
parentBuilder
.
sessionAttributes
.
keySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
parentBuilder
.
sessionAttributes
.
entrySet
())
{
String
attributeName
=
entry
.
getKey
();
if
(!
this
.
sessionAttributes
.
containsKey
(
attributeName
))
{
this
.
sessionAttributes
.
put
(
attributeName
,
parentBuilder
.
sessionAttributes
.
get
(
attributeName
));
this
.
sessionAttributes
.
put
(
attributeName
,
entry
.
getValue
(
));
}
}
for
(
String
attributeName
:
parentBuilder
.
flashAttributes
.
keySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
parentBuilder
.
flashAttributes
.
entrySet
())
{
String
attributeName
=
entry
.
getKey
();
if
(!
this
.
flashAttributes
.
containsKey
(
attributeName
))
{
this
.
flashAttributes
.
put
(
attributeName
,
parentBuilder
.
flashAttributes
.
get
(
attributeName
));
this
.
flashAttributes
.
put
(
attributeName
,
entry
.
getValue
(
));
}
}
...
...
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java
浏览文件 @
9ca8681f
...
...
@@ -351,10 +351,11 @@ class ControllerMethodResolver {
if
(
targetMethod
==
null
)
{
// Global exception handlers...
for
(
ControllerAdviceBean
advice
:
this
.
exceptionHandlerAdviceCache
.
keySet
())
{
for
(
Map
.
Entry
<
ControllerAdviceBean
,
ExceptionHandlerMethodResolver
>
entry
:
this
.
exceptionHandlerAdviceCache
.
entrySet
())
{
ControllerAdviceBean
advice
=
entry
.
getKey
();
if
(
advice
.
isApplicableToBeanType
(
handlerType
))
{
targetBean
=
advice
.
resolveBean
();
targetMethod
=
this
.
exceptionHandlerAdviceCache
.
get
(
advice
).
resolveMethodByThrowable
(
ex
);
targetMethod
=
entry
.
getValue
(
).
resolveMethodByThrowable
(
ex
);
if
(
targetMethod
!=
null
)
{
break
;
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/WebContentInterceptor.java
浏览文件 @
9ca8681f
...
...
@@ -213,9 +213,9 @@ public class WebContentInterceptor extends WebContentGenerator implements Handle
return
cacheControl
;
}
// Pattern match?
for
(
String
registeredPath
:
this
.
cacheControlMappings
.
ke
ySet
())
{
if
(
this
.
pathMatcher
.
match
(
registeredPath
,
urlPath
))
{
return
this
.
cacheControlMappings
.
get
(
registeredPath
);
for
(
Map
.
Entry
<
String
,
CacheControl
>
entry
:
this
.
cacheControlMappings
.
entr
ySet
())
{
if
(
this
.
pathMatcher
.
match
(
entry
.
getKey
()
,
urlPath
))
{
return
entry
.
getValue
(
);
}
}
return
null
;
...
...
@@ -238,9 +238,9 @@ public class WebContentInterceptor extends WebContentGenerator implements Handle
return
cacheSeconds
;
}
// Pattern match?
for
(
String
registeredPath
:
this
.
cacheMappings
.
ke
ySet
())
{
if
(
this
.
pathMatcher
.
match
(
registeredPath
,
urlPath
))
{
return
this
.
cacheMappings
.
get
(
registeredPath
);
for
(
Map
.
Entry
<
String
,
Integer
>
entry
:
this
.
cacheMappings
.
entr
ySet
())
{
if
(
this
.
pathMatcher
.
match
(
entry
.
getKey
()
,
urlPath
))
{
return
entry
.
getValue
(
);
}
}
return
null
;
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/support/AbstractFlashMapManager.java
浏览文件 @
9ca8681f
...
...
@@ -19,6 +19,7 @@ package org.springframework.web.servlet.support;
import
java.util.Collections
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -169,12 +170,12 @@ public abstract class AbstractFlashMapManager implements FlashMapManager {
}
MultiValueMap
<
String
,
String
>
actualParams
=
getOriginatingRequestParams
(
request
);
MultiValueMap
<
String
,
String
>
expectedParams
=
flashMap
.
getTargetRequestParams
();
for
(
String
expectedName
:
expectedParams
.
ke
ySet
())
{
List
<
String
>
actualValues
=
actualParams
.
get
(
e
xpectedName
);
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
expectedParams
.
entr
ySet
())
{
List
<
String
>
actualValues
=
actualParams
.
get
(
e
ntry
.
getKey
()
);
if
(
actualValues
==
null
)
{
return
false
;
}
for
(
String
expectedValue
:
e
xpectedParams
.
get
(
expectedName
))
{
for
(
String
expectedValue
:
e
ntry
.
getValue
(
))
{
if
(!
actualValues
.
contains
(
expectedValue
))
{
return
false
;
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTag.java
浏览文件 @
9ca8681f
...
...
@@ -485,8 +485,8 @@ public abstract class AbstractHtmlElementTag extends AbstractDataBoundFormElemen
writeOptionalAttribute
(
tagWriter
,
ONKEYDOWN_ATTRIBUTE
,
getOnkeydown
());
if
(!
CollectionUtils
.
isEmpty
(
this
.
dynamicAttributes
))
{
for
(
String
attr
:
this
.
dynamicAttributes
.
ke
ySet
())
{
tagWriter
.
writeOptionalAttributeValue
(
attr
,
getDisplayString
(
this
.
dynamicAttributes
.
get
(
attr
)));
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
this
.
dynamicAttributes
.
entr
ySet
())
{
tagWriter
.
writeOptionalAttributeValue
(
entry
.
getKey
(),
getDisplayString
(
entry
.
getValue
(
)));
}
}
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
浏览文件 @
9ca8681f
...
...
@@ -704,9 +704,9 @@ public class FormTag extends AbstractHtmlElementTag {
if
(!
CollectionUtils
.
isEmpty
(
hiddenFields
))
{
Assert
.
state
(
this
.
tagWriter
!=
null
,
"No TagWriter set"
);
this
.
tagWriter
.
appendValue
(
"<div>\n"
);
for
(
String
name
:
hiddenFields
.
ke
ySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
hiddenFields
.
entr
ySet
())
{
this
.
tagWriter
.
appendValue
(
"<input type=\"hidden\" "
);
this
.
tagWriter
.
appendValue
(
"name=\""
+
name
+
"\" value=\""
+
hiddenFields
.
get
(
name
)
+
"\" "
);
this
.
tagWriter
.
appendValue
(
"name=\""
+
entry
.
getKey
()
+
"\" value=\""
+
entry
.
getValue
(
)
+
"\" "
);
this
.
tagWriter
.
appendValue
(
"/>\n"
);
}
this
.
tagWriter
.
appendValue
(
"</div>"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录