Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
8f1f8dd6
Commit
8f1f8dd6
authored
Dec 19, 2015
by
mnhock
Committed by
Andy Wilkinson
Jan 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use entrySet() rather than using keySet() and then calling get(key)
Closes gh-4813
parent
48d22f93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
RequestMappingEndpoint.java
...amework/boot/actuate/endpoint/RequestMappingEndpoint.java
+9
-8
EndpointMBeanExporter.java
...work/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
+4
-3
WebMvcAutoConfiguration.java
...ework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
+6
-4
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/RequestMappingEndpoint.java
View file @
8f1f8dd6
...
...
@@ -21,6 +21,7 @@ import java.util.Collections;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
org.springframework.aop.support.AopUtils
;
import
org.springframework.beans.BeansException
;
...
...
@@ -92,11 +93,11 @@ public class RequestMappingEndpoint extends AbstractEndpoint<Map<String, Object>
Map
<?,
HandlerMethod
>
methods
=
applicationContext
.
getBean
(
name
,
AbstractHandlerMethodMapping
.
class
)
.
getHandlerMethods
();
for
(
Object
key
:
methods
.
ke
ySet
())
{
for
(
Entry
<?,
HandlerMethod
>
method
:
methods
.
entr
ySet
())
{
Map
<
String
,
String
>
map
=
new
LinkedHashMap
<
String
,
String
>();
map
.
put
(
"bean"
,
name
);
map
.
put
(
"method"
,
methods
.
get
(
key
).
toString
());
result
.
put
(
key
.
toString
(),
map
);
map
.
put
(
"method"
,
method
.
getValue
(
).
toString
());
result
.
put
(
method
.
getKey
()
.
toString
(),
map
);
}
}
}
...
...
@@ -107,11 +108,11 @@ public class RequestMappingEndpoint extends AbstractEndpoint<Map<String, Object>
if
(
applicationContext
!=
null
)
{
Map
<
String
,
AbstractUrlHandlerMapping
>
mappings
=
applicationContext
.
getBeansOfType
(
AbstractUrlHandlerMapping
.
class
);
for
(
String
name
:
mappings
.
ke
ySet
())
{
AbstractUrlHandlerMapping
mapping
=
mappings
.
get
(
name
);
Map
<
String
,
Object
>
handlers
=
getHandlerMap
(
mapping
);
for
(
String
key
:
handlers
.
keySet
())
{
result
.
put
(
key
,
Collections
.
singletonMap
(
"bean"
,
name
));
for
(
Entry
<
String
,
AbstractUrlHandlerMapping
>
mapping
:
mappings
.
entr
ySet
())
{
Map
<
String
,
Object
>
handlers
=
getHandlerMap
(
mapping
.
getValue
()
);
for
(
Entry
<
String
,
Object
>
handler
:
handlers
.
entrySet
())
{
result
.
put
(
handler
.
getKey
(),
Collections
.
singletonMap
(
"bean"
,
mapping
.
getKey
()
));
}
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
View file @
8f1f8dd6
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-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.
...
...
@@ -18,6 +18,7 @@ package org.springframework.boot.actuate.endpoint.jmx;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.concurrent.locks.ReentrantLock
;
...
...
@@ -241,8 +242,8 @@ public class EndpointMBeanExporter extends MBeanExporter
}
StringBuilder
builder
=
new
StringBuilder
();
for
(
Object
key
:
this
.
objectNameStaticProperties
.
ke
ySet
())
{
builder
.
append
(
","
+
key
+
"="
+
this
.
objectNameStaticProperties
.
get
(
key
));
for
(
Entry
<
Object
,
Object
>
name
:
this
.
objectNameStaticProperties
.
entr
ySet
())
{
builder
.
append
(
","
+
name
.
getKey
()
+
"="
+
name
.
getValue
(
));
}
return
builder
.
toString
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
View file @
8f1f8dd6
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-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.
...
...
@@ -21,6 +21,7 @@ import java.util.Collections;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
javax.servlet.Servlet
;
...
...
@@ -132,7 +133,8 @@ public class WebMvcAutoConfiguration {
@EnableConfigurationProperties
({
WebMvcProperties
.
class
,
ResourceProperties
.
class
})
public
static
class
WebMvcAutoConfigurationAdapter
extends
WebMvcConfigurerAdapter
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
WebMvcConfigurerAdapter
.
class
);
private
static
final
Log
logger
=
LogFactory
.
getLog
(
WebMvcConfigurerAdapter
.
class
);
@Autowired
private
ResourceProperties
resourceProperties
=
new
ResourceProperties
();
...
...
@@ -162,8 +164,8 @@ public class WebMvcAutoConfiguration {
@Override
public
void
configureContentNegotiation
(
ContentNegotiationConfigurer
configurer
)
{
Map
<
String
,
MediaType
>
mediaTypes
=
this
.
mvcProperties
.
getMediaTypes
();
for
(
String
extension
:
mediaTypes
.
ke
ySet
())
{
configurer
.
mediaType
(
extension
,
mediaTypes
.
get
(
extension
));
for
(
Entry
<
String
,
MediaType
>
mediaType
:
mediaTypes
.
entr
ySet
())
{
configurer
.
mediaType
(
mediaType
.
getKey
(),
mediaType
.
getValue
(
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment