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
825dd0a2
Commit
825dd0a2
authored
Sep 16, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.3.x'
parents
49f28b79
3b52909f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
17 deletions
+68
-17
MetricFilterAutoConfiguration.java
.../actuate/autoconfigure/MetricFilterAutoConfiguration.java
+1
-1
AbstractNestedCondition.java
...boot/autoconfigure/condition/AbstractNestedCondition.java
+50
-14
WebMvcAutoConfiguration.java
...ework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
+1
-0
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+6
-0
AnyNestedConditionTests.java
...boot/autoconfigure/condition/AnyNestedConditionTests.java
+3
-1
WebMvcAutoConfigurationTests.java
.../boot/autoconfigure/web/WebMvcAutoConfigurationTests.java
+6
-0
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-0
launch.script
...urces/org/springframework/boot/loader/tools/launch.script
+0
-1
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfiguration.java
View file @
825dd0a2
...
...
@@ -64,7 +64,7 @@ public class MetricFilterAutoConfiguration {
}
@Bean
public
MetricsFilter
metricFilter
()
{
public
MetricsFilter
metric
s
Filter
()
{
return
new
MetricsFilter
(
this
.
counterService
,
this
.
gaugeService
,
this
.
properties
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java
View file @
825dd0a2
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-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.
...
...
@@ -161,27 +161,63 @@ abstract class AbstractNestedCondition extends SpringBootCondition
for
(
Map
.
Entry
<
AnnotationMetadata
,
List
<
Condition
>>
entry
:
this
.
memberConditions
.
entrySet
())
{
AnnotationMetadata
metadata
=
entry
.
getKey
();
for
(
Condition
condition
:
entry
.
getValue
())
{
outcomes
.
add
(
getConditionOutcome
(
metadata
,
condition
));
}
List
<
Condition
>
conditions
=
entry
.
getValue
();
outcomes
.
add
(
new
MemberOutcomes
(
this
.
context
,
metadata
,
conditions
)
.
getUltimateOutcome
());
}
return
Collections
.
unmodifiableList
(
outcomes
);
}
}
private
static
class
MemberOutcomes
{
private
final
ConditionContext
context
;
private
final
AnnotationMetadata
metadata
;
private
final
List
<
ConditionOutcome
>
outcomes
;
MemberOutcomes
(
ConditionContext
context
,
AnnotationMetadata
metadata
,
List
<
Condition
>
conditions
)
{
this
.
context
=
context
;
this
.
metadata
=
metadata
;
this
.
outcomes
=
new
ArrayList
<
ConditionOutcome
>(
conditions
.
size
());
for
(
Condition
condition
:
conditions
)
{
this
.
outcomes
.
add
(
getConditionOutcome
(
metadata
,
condition
));
}
}
private
ConditionOutcome
getConditionOutcome
(
AnnotationMetadata
metadata
,
Condition
condition
)
{
String
className
=
ClassUtils
.
getShortName
(
metadata
.
getClassName
());
if
(
condition
instanceof
SpringBootCondition
)
{
ConditionOutcome
outcome
=
((
SpringBootCondition
)
condition
)
.
getMatchOutcome
(
this
.
context
,
metadata
);
ConditionMessage
message
=
outcome
.
getConditionMessage
()
.
append
(
"on member "
+
className
);
return
new
ConditionOutcome
(
outcome
.
isMatch
(),
message
);
return
((
SpringBootCondition
)
condition
).
getMatchOutcome
(
this
.
context
,
metadata
);
}
return
new
ConditionOutcome
(
condition
.
matches
(
this
.
context
,
metadata
),
(
ConditionMessage
)
null
);
}
public
ConditionOutcome
getUltimateOutcome
()
{
ConditionMessage
.
Builder
message
=
ConditionMessage
.
forCondition
(
"NestedCondition on "
+
ClassUtils
.
getShortName
(
this
.
metadata
.
getClassName
()));
if
(
this
.
outcomes
.
size
()
==
1
)
{
ConditionOutcome
outcome
=
this
.
outcomes
.
get
(
0
);
return
new
ConditionOutcome
(
outcome
.
isMatch
(),
message
.
because
(
outcome
.
getMessage
()));
}
List
<
ConditionOutcome
>
match
=
new
ArrayList
<
ConditionOutcome
>();
List
<
ConditionOutcome
>
nonMatch
=
new
ArrayList
<
ConditionOutcome
>();
for
(
ConditionOutcome
outcome
:
this
.
outcomes
)
{
(
outcome
.
isMatch
()
?
match
:
nonMatch
).
add
(
outcome
);
}
if
(
nonMatch
.
isEmpty
())
{
return
ConditionOutcome
.
match
(
message
.
found
(
"matching nested conditions"
).
items
(
match
));
}
boolean
matches
=
condition
.
matches
(
this
.
context
,
metadata
);
return
new
ConditionOutcome
(
matches
,
ConditionMessage
.
forCondition
(
"NestedCondition"
)
.
because
(
"nested on member "
+
className
));
return
ConditionOutcome
.
noMatch
(
message
.
found
(
"non-matching nested conditions"
).
items
(
nonMatch
));
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
View file @
825dd0a2
...
...
@@ -132,6 +132,7 @@ public class WebMvcAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
HttpPutFormContentFilter
.
class
)
@ConditionalOnProperty
(
prefix
=
"spring.mvc.formcontent.putfilter"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
public
OrderedHttpPutFormContentFilter
httpPutFormContentFilter
()
{
return
new
OrderedHttpPutFormContentFilter
();
}
...
...
spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
825dd0a2
...
...
@@ -279,6 +279,12 @@
"description"
:
"Enable resolution of favicon.ico."
,
"defaultValue"
:
true
},
{
"name"
:
"spring.mvc.formcontent.putfilter.enabled"
,
"type"
:
"java.lang.Boolean"
,
"description"
:
"Enable Spring's HttpPutFormContentFilter."
,
"defaultValue"
:
true
},
{
"name"
:
"spring.rabbitmq.dynamic"
,
"type"
:
"java.lang.Boolean"
,
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/AnyNestedConditionTests.java
View file @
825dd0a2
...
...
@@ -30,12 +30,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link AnyNestedCondition}.
*
* @author Phillip Webb
* @author Dave Syer
*/
public
class
AnyNestedConditionTests
{
@Test
public
void
neither
()
throws
Exception
{
AnnotationConfigApplicationContext
context
=
load
(
OnPropertyAorBCondition
.
class
);
AnnotationConfigApplicationContext
context
=
load
(
Config
.
class
);
assertThat
(
context
.
containsBean
(
"myBean"
)).
isFalse
();
context
.
close
();
}
...
...
@@ -91,6 +92,7 @@ public class AnyNestedConditionTests {
}
@ConditionalOnExpression
(
"true"
)
@ConditionalOnProperty
(
"b"
)
static
class
HasPropertyB
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java
View file @
825dd0a2
...
...
@@ -504,6 +504,12 @@ public class WebMvcAutoConfigurationTests {
.
hasSize
(
1
);
}
@Test
public
void
httpPutFormContentFilterCanBeDisabled
()
throws
Exception
{
load
((
Class
<?>)
null
,
"spring.mvc.formcontent.putfilter.enabled=false"
);
assertThat
(
this
.
context
.
getBeansOfType
(
HttpPutFormContentFilter
.
class
)).
isEmpty
();
}
@Test
public
void
customConfigurableWebBindingInitializer
()
{
load
(
CustomConfigurableWebBindingInitializer
.
class
);
...
...
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
825dd0a2
...
...
@@ -341,6 +341,7 @@ content into your application; rather pick only the properties that you need.
spring.mvc.dispatch-trace-request=false # Dispatch TRACE requests to the FrameworkServlet doService method.
spring.mvc.dispatch-options-request=true # Dispatch OPTIONS requests to the FrameworkServlet doService method.
spring.mvc.favicon.enabled=true # Enable resolution of favicon.ico.
spring.mvc.formcontent.putfilter.enabled=true # Enable Spring's HttpPutFormContentFilter.
spring.mvc.ignore-default-model-on-redirect=true # If the content of the "default" model should be ignored during redirect scenarios.
spring.mvc.locale= # Locale to use. By default, this locale is overridden by the "Accept-Language" header.
spring.mvc.locale-resolver=accept-header # Define how the locale should be resolved.
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
View file @
825dd0a2
...
...
@@ -147,7 +147,6 @@ do_start() {
mkdir
"
$PID_FOLDER
"
&> /dev/null
if
[[
-n
"
$run_user
"
]]
;
then
checkPermissions
||
return
$?
chown
"
$run_user
"
"
$PID_FOLDER
"
chown
"
$run_user
"
"
$pid_file
"
chown
"
$run_user
"
"
$log_file
"
if
[
$USE_START_STOP_DAEMON
=
true
]
&&
type
start-stop-daemon
>
/dev/null 2>&1
;
then
...
...
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