Skip to content

Commit d94f545

Browse files
committed
Merge pull request #10457 from Johnny Lim
* gh-10457: Polish
2 parents bcbf7b5 + bfa291f commit d94f545

File tree

16 files changed

+99
-98
lines changed

16 files changed

+99
-98
lines changed

CONTRIBUTING.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Running a full build is a two phase process.
115115
Preparing the build will compile and install the `spring-boot-maven-plugin` so that it
116116
can be referenced during the full build. It also generates a `settings.xml` file that
117117
enables a `snapshot`, `milestone` or `release` profiles based on the version being
118-
build. To prepare the build, from the root directory use:
118+
built. To prepare the build, from the root directory use:
119119

120120
[indent=0]
121121
----

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class SessionProperties {
3838
*/
3939
private StoreType storeType;
4040

41-
private Integer timeout;
41+
private final Integer timeout;
4242

4343
private final Hazelcast hazelcast = new Hazelcast();
4444

spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,14 +39,14 @@
3939
*/
4040
public class DefaultCommandFactory implements CommandFactory {
4141

42-
private static final List<Command> DEFAULT_COMMANDS = Arrays.<Command>asList(
42+
private static final List<Command> defaultCommands = Arrays.<Command>asList(
4343
new VersionCommand(), new RunCommand(), new TestCommand(), new GrabCommand(),
4444
new JarCommand(), new WarCommand(), new InstallCommand(),
4545
new UninstallCommand(), new InitCommand());
4646

4747
@Override
4848
public Collection<Command> getCommands() {
49-
return DEFAULT_COMMANDS;
49+
return defaultCommands;
5050
}
5151

5252
}

spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,30 +42,31 @@
4242
@Order(Ordered.LOWEST_PRECEDENCE)
4343
public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostProcessor {
4444

45-
private static final Map<String, Object> PROPERTIES;
45+
private static final Map<String, Object> properties;
4646

4747
static {
48-
Map<String, Object> properties = new HashMap<String, Object>();
49-
properties.put("spring.thymeleaf.cache", "false");
50-
properties.put("spring.freemarker.cache", "false");
51-
properties.put("spring.groovy.template.cache", "false");
52-
properties.put("spring.mustache.cache", "false");
53-
properties.put("server.session.persistent", "true");
54-
properties.put("spring.h2.console.enabled", "true");
55-
properties.put("spring.resources.cache-period", "0");
56-
properties.put("spring.resources.chain.cache", "false");
57-
properties.put("spring.template.provider.cache", "false");
58-
properties.put("spring.mvc.log-resolved-exception", "true");
59-
properties.put("server.jsp-servlet.init-parameters.development", "true");
60-
PROPERTIES = Collections.unmodifiableMap(properties);
48+
Map<String, Object> devToolsProperties = new HashMap<String, Object>();
49+
devToolsProperties.put("spring.thymeleaf.cache", "false");
50+
devToolsProperties.put("spring.freemarker.cache", "false");
51+
devToolsProperties.put("spring.groovy.template.cache", "false");
52+
devToolsProperties.put("spring.mustache.cache", "false");
53+
devToolsProperties.put("server.session.persistent", "true");
54+
devToolsProperties.put("spring.h2.console.enabled", "true");
55+
devToolsProperties.put("spring.resources.cache-period", "0");
56+
devToolsProperties.put("spring.resources.chain.cache", "false");
57+
devToolsProperties.put("spring.template.provider.cache", "false");
58+
devToolsProperties.put("spring.mvc.log-resolved-exception", "true");
59+
devToolsProperties.put("server.servlet.jsp.init-parameters.development", "true");
60+
devToolsProperties.put("spring.reactor.stacktrace-mode.enabled", "true");
61+
properties = Collections.unmodifiableMap(devToolsProperties);
6162
}
6263

6364
@Override
6465
public void postProcessEnvironment(ConfigurableEnvironment environment,
6566
SpringApplication application) {
6667
if (isLocalApplication(environment) && canAddProperties(environment)) {
6768
PropertySource<?> propertySource = new MapPropertySource("refresh",
68-
PROPERTIES);
69+
properties);
6970
environment.getPropertySources().addLast(propertySource);
7071
}
7172
}

spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ content into your application; rather pick only the properties that you need.
10221022
endpoints.flyway.sensitive= # Mark if the endpoint exposes sensitive information.
10231023
endpoints.health.enabled= # Enable the endpoint.
10241024
endpoints.health.id= # Endpoint identifier.
1025-
endpoints.health.mapping.*= # Mapping of health statuses to HttpStatus codes. By default, registered health statuses map to sensible defaults (i.e. UP maps to 200).
1025+
endpoints.health.mapping.*= # Mapping of health statuses to HTTP status codes. By default, registered health statuses map to sensible defaults (i.e. UP maps to 200).
10261026
endpoints.health.path= # Endpoint path.
10271027
endpoints.health.sensitive= # Mark if the endpoint exposes sensitive information.
10281028
endpoints.health.time-to-live=1000 # Time to live for cached result, in milliseconds.

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ respectively.
20612061
Spring Data REST can expose the `Repository` implementations as REST endpoints for you as
20622062
long as Spring MVC has been enabled for the application.
20632063

2064-
Spring Boot exposes as set of useful properties from the `spring.data.rest` namespace that
2064+
Spring Boot exposes a set of useful properties from the `spring.data.rest` namespace that
20652065
customize the
20662066
{spring-data-rest-javadoc}/core/config/RepositoryRestConfiguration.{dc-ext}[`RepositoryRestConfiguration`].
20672067
If you need to provide additional customization, you should use a

spring-boot-docs/src/main/asciidoc/production-ready-features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ to your application properties:
397397
The HTTP status code in the response reflects the overall health status (e.g. `UP`
398398
maps to 200, `OUT_OF_SERVICE` or `DOWN` to 503). You might also want to register custom
399399
status mappings with the `HealthMvcEndpoint` if you access the health endpoint over HTTP.
400-
For example, the following maps `FATAL` to `HttpStatus.SERVICE_UNAVAILABLE`:
400+
For example, the following maps `FATAL` to 503 (service unavailable):
401401

402402
[source,properties,indent=0]
403403
----

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ can be achieved as follows:
18761876
You can also customize the static resource locations using
18771877
`spring.resources.static-locations` (replacing the default values with a list of directory
18781878
locations). If you do this the default welcome page detection will switch to your custom
1879-
locations, so if there is an `index.html` in any of your locations on startup, it will be
1879+
locations. So if there is an `index.html` in any of your locations on startup, it will be
18801880
the home page of the application.
18811881

18821882
In addition to the '`standard`' static resource locations above, a special case is made

spring-boot-test/src/main/java/org/springframework/boot/test/context/ImportsContextCustomizer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ static class ContextCustomizerKey {
228228

229229
private static final Class<?>[] NO_IMPORTS = {};
230230

231-
private static final Set<AnnotationFilter> ANNOTATION_FILTERS;
231+
private static final Set<AnnotationFilter> annotationFilters;
232232

233233
static {
234234
Set<AnnotationFilter> filters = new HashSet<AnnotationFilter>();
235235
filters.add(new JavaLangAnnotationFilter());
236236
filters.add(new KotlinAnnotationFilter());
237237
filters.add(new SpockAnnotationFilter());
238-
ANNOTATION_FILTERS = Collections.unmodifiableSet(filters);
238+
annotationFilters = Collections.unmodifiableSet(filters);
239239
}
240240

241241
private final Set<Object> key;
@@ -274,7 +274,7 @@ private void collectElementAnnotations(AnnotatedElement element,
274274
}
275275

276276
private boolean isIgnoredAnnotation(Annotation annotation) {
277-
for (AnnotationFilter annotationFilter : ANNOTATION_FILTERS) {
277+
for (AnnotationFilter annotationFilter : annotationFilters) {
278278
if (annotationFilter.isIgnored(annotation)) {
279279
return true;
280280
}

spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/fieldvalues/javac/JavaCompilerFieldValuesParser.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private static class FieldCollector implements TreeVisitor {
7676
WRAPPER_TYPES = Collections.unmodifiableMap(types);
7777
}
7878

79-
private static final Map<Class<?>, Object> DEFAULT_TYPE_VALUES;
79+
private static final Map<Class<?>, Object> defaultTypeValues;
8080

8181
static {
8282
Map<Class<?>, Object> values = new HashMap<Class<?>, Object>();
@@ -85,16 +85,16 @@ private static class FieldCollector implements TreeVisitor {
8585
values.put(Short.class, (short) 0);
8686
values.put(Integer.class, 0);
8787
values.put(Long.class, (long) 0);
88-
DEFAULT_TYPE_VALUES = Collections.unmodifiableMap(values);
88+
defaultTypeValues = Collections.unmodifiableMap(values);
8989
}
9090

91-
private static final Map<String, Object> WELL_KNOWN_STATIC_FINALS;
91+
private static final Map<String, Object> wellKnownStaticFinals;
9292

9393
static {
9494
Map<String, Object> values = new HashMap<String, Object>();
9595
values.put("Boolean.TRUE", true);
9696
values.put("Boolean.FALSE", false);
97-
WELL_KNOWN_STATIC_FINALS = Collections.unmodifiableMap(values);
97+
wellKnownStaticFinals = Collections.unmodifiableMap(values);
9898
}
9999

100100
private final Map<String, Object> fieldValues = new HashMap<String, Object>();
@@ -115,7 +115,7 @@ public void visitVariable(VariableTree variable) throws Exception {
115115
private Object getValue(VariableTree variable) throws Exception {
116116
ExpressionTree initializer = variable.getInitializer();
117117
Class<?> wrapperType = WRAPPER_TYPES.get(variable.getType());
118-
Object defaultValue = DEFAULT_TYPE_VALUES.get(wrapperType);
118+
Object defaultValue = defaultTypeValues.get(wrapperType);
119119
if (initializer != null) {
120120
return getValue(initializer, defaultValue);
121121
}
@@ -148,7 +148,7 @@ private Object getValue(ExpressionTree expression, Object defaultValue)
148148
return this.staticFinals.get(expression.toString());
149149
}
150150
if (expression.getKind().equals("MEMBER_SELECT")) {
151-
return WELL_KNOWN_STATIC_FINALS.get(expression.toString());
151+
return wellKnownStaticFinals.get(expression.toString());
152152
}
153153
return defaultValue;
154154
}

0 commit comments

Comments
 (0)