Skip to content

Commit 3b09791

Browse files
committed
Merge pull request #40900 from cmabdullah
* pr/40900: Fix various minor inconsistencies in the documentation Closes gh-40900
2 parents 96cfc14 + ab2ba67 commit 3b09791

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/application.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When reading the code, remember the following rules of thumb:
4141

4242
* Look for classes called `+*AutoConfiguration+` and read their sources.
4343
Pay special attention to the `+@Conditional*+` annotations to find out what features they enable and when.
44-
Add `--debug` to the command line or a System property `-Ddebug` to get a log on the console of all the auto-configuration decisions that were made in your app.
44+
Add `--debug` to the command line or the System property `-Ddebug` to get a log on the console of all the auto-configuration decisions that were made in your app.
4545
In a running application with actuator enabled, look at the `conditions` endpoint (`/actuator/conditions` or the JMX equivalent) for the same information.
4646
* Look for classes that are `@ConfigurationProperties` (such as {spring-boot-autoconfigure-module-code}/web/ServerProperties.java[`ServerProperties`]) and read from there the available external configuration options.
4747
The `@ConfigurationProperties` annotation has a `name` attribute that acts as a prefix to external properties.
@@ -103,5 +103,5 @@ Not all Spring applications have to be web applications (or web services).
103103
If you want to execute some code in a `main` method but also bootstrap a Spring application to set up the infrastructure to use, you can use the `SpringApplication` features of Spring Boot.
104104
A `SpringApplication` changes its `ApplicationContext` class, depending on whether it thinks it needs a web application or not.
105105
The first thing you can do to help it is to leave server-related dependencies (such as the servlet API) off the classpath.
106-
If you cannot do that (for example, you run two applications from the same code base) then you can explicitly call `setWebApplicationType(WebApplicationType.NONE)` on your `SpringApplication` instance or set the `applicationContextClass` property (through the Java API or with external properties).
106+
If you cannot do that (for example, if you run two applications from the same code base) then you can explicitly call `setWebApplicationType(WebApplicationType.NONE)` on your `SpringApplication` instance or set the `applicationContextClass` property (through the Java API or with external properties).
107107
Application code that you want to run as your business logic can be implemented as a `CommandLineRunner` and dropped into the context as a `@Bean` definition.

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-access.adoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The following example shows how to define a data source in a bean:
1515

1616
include::code:custom/MyDataSourceConfiguration[]
1717

18-
The following example shows how to define a data source by setting properties:
18+
The following example shows how to define a data source by setting its properties:
1919

2020
[source,yaml,indent=0,subs="verbatim",configblocks]
2121
----
@@ -29,7 +29,7 @@ The following example shows how to define a data source by setting properties:
2929
Assuming that `SomeDataSource` has regular JavaBean properties for the URL, the username, and the pool size, these settings are bound automatically before the `DataSource` is made available to other components.
3030

3131
Spring Boot also provides a utility builder class, called `DataSourceBuilder`, that can be used to create one of the standard data sources (if it is on the classpath).
32-
The builder can detect the one to use based on what is available on the classpath.
32+
The builder can detect which one to use based on what is available on the classpath.
3333
It also auto-detects the driver based on the JDBC URL.
3434

3535
The following example shows how to create a data source by using a `DataSourceBuilder`:
@@ -70,7 +70,7 @@ In that case, you must rewrite your configuration as follows:
7070
You can fix that by forcing the connection pool to use and return a dedicated implementation rather than `DataSource`.
7171
You cannot change the implementation at runtime, but the list of options will be explicit.
7272

73-
The following example shows how create a `HikariDataSource` with `DataSourceBuilder`:
73+
The following example shows how to create a `HikariDataSource` with `DataSourceBuilder`:
7474

7575
include::code:simple/MyDataSourceConfiguration[]
7676

@@ -107,7 +107,7 @@ See "`<<data#data.sql.datasource>>`" in the "`Spring Boot features`" section and
107107

108108
[[howto.data-access.configure-two-datasources]]
109109
=== Configure Two DataSources
110-
If you need to configure multiple data sources, you can apply the same tricks that are described in the previous section.
110+
If you need to configure multiple data sources, you can apply the same tricks that were described in the previous section.
111111
You must, however, mark one of the `DataSource` instances as `@Primary`, because various auto-configurations down the road expect to be able to get one by type.
112112

113113
If you create your own `DataSource`, the auto-configuration backs off.
@@ -208,7 +208,7 @@ If you use other forms, such as `batchSize` or `batch-size`, Hibernate will not
208208
====
209209

210210
TIP: If you need to apply advanced customization to Hibernate properties, consider registering a `HibernatePropertiesCustomizer` bean that will be invoked prior to creating the `EntityManagerFactory`.
211-
This takes precedence to anything that is applied by the auto-configuration.
211+
This takes precedence over anything that is applied by the auto-configuration.
212212

213213

214214

@@ -286,7 +286,7 @@ It scans entities located in the same package as `Order`.
286286
It is possible to map additional JPA properties using the `app.first.jpa` namespace.
287287

288288
NOTE: When you create a bean for `LocalContainerEntityManagerFactoryBean` yourself, any customization that was applied during the creation of the auto-configured `LocalContainerEntityManagerFactoryBean` is lost.
289-
For example, in case of Hibernate, any properties under the `spring.jpa.hibernate` prefix will not be automatically applied to your `LocalContainerEntityManagerFactoryBean`.
289+
For example, in the case of Hibernate, any properties under the `spring.jpa.hibernate` prefix will not be automatically applied to your `LocalContainerEntityManagerFactoryBean`.
290290
If you were relying on these properties for configuring things like the naming strategy or the DDL mode, you will need to explicitly configure that when creating the `LocalContainerEntityManagerFactoryBean` bean.
291291

292292
You should provide a similar configuration for any additional data sources for which you need JPA access.
@@ -349,7 +349,7 @@ If you need to specify an order, make sure it is higher than 0.
349349
=== Configure a Component that is Used by JPA
350350
If you want to configure a component that JPA uses, then you need to ensure that the component is initialized before JPA.
351351
When the component is auto-configured, Spring Boot takes care of this for you.
352-
For example, when Flyway is auto-configured, Hibernate is configured to depend upon Flyway so that Flyway has a chance to initialize the database before Hibernate tries to use it.
352+
For example, when Flyway is auto-configured, Hibernate is configured to depend on Flyway so that Flyway has a chance to initialize the database before Hibernate tries to use it.
353353

354354
If you are configuring a component yourself, you can use an `EntityManagerFactoryDependsOnPostProcessor` subclass as a convenient way of setting up the necessary dependencies.
355355
For example, if you use Hibernate Search with Elasticsearch as its index manager, any `EntityManagerFactory` beans must be configured to depend on the `elasticsearchClient` bean, as shown in the following example:

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/properties-and-configuration.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is possible in both Maven and Gradle.
1313

1414
[[howto.properties-and-configuration.expand-properties.maven]]
1515
==== Automatic Property Expansion Using Maven
16-
You can automatically expand properties from the Maven project by using resource filtering.
16+
You can automatically expand properties in the Maven project by using resource filtering.
1717
If you use the `spring-boot-starter-parent`, you can then refer to your Maven '`project properties`' with `@..@` placeholders, as shown in the following example:
1818

1919
[source,yaml,indent=0,subs="verbatim",configblocks]
@@ -126,7 +126,7 @@ Given the examples above, if we have the following configuration:
126126
banner-mode: "console"
127127
----
128128

129-
The actual application will show the banner (as overridden by configuration) and uses three sources for the `ApplicationContext`.
129+
The actual application will show the banner (as overridden by configuration) and use three sources for the `ApplicationContext`.
130130
The application sources are:
131131

132132
. `MyApplication` (from the code)
@@ -146,7 +146,7 @@ You can also provide the following System properties (or environment variables)
146146
A separate `Environment` property source is set up for this document and it can be overridden by system properties, environment variables, or the command line.
147147

148148
No matter what you set in the environment, Spring Boot always loads `application.properties` as described above.
149-
By default, if YAML is used, then files with the '`.yaml`' and '`.yml`' extension are also added to the list.
149+
By default, if YAML is used, then files with the '`.yaml`' and '`.yml`' extensions are also added to the list.
150150

151151
TIP: If you want detailed information about the files that are being loaded you can <<features#features.logging.log-levels, set the logging level>> of `org.springframework.boot.context.config` to `trace`.
152152

@@ -167,7 +167,7 @@ TIP: If you inherit from the `spring-boot-starter-parent` POM, the default filte
167167
If you have enabled Maven filtering for the `application.properties` directly, you may want to also change the default filter token to use https://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters[other delimiters].
168168

169169
NOTE: In this specific case, the port binding works in a PaaS environment such as Heroku or Cloud Foundry.
170-
In those two platforms, the `PORT` environment variable is set automatically and Spring can bind to capitalized synonyms for `Environment` properties.
170+
On those two platforms, the `PORT` environment variable is set automatically and Spring can bind to capitalized synonyms for `Environment` properties.
171171

172172

173173

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/spring-mvc.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ It has some useful methods to access the default and user-enhanced message conve
135135

136136
As in normal MVC usage, any `WebMvcConfigurer` beans that you provide can also contribute converters by overriding the `configureMessageConverters` method.
137137
However, unlike with normal MVC, you can supply only additional converters that you need (because Spring Boot uses the same mechanism to contribute its defaults).
138-
Finally, if you opt out of the Spring Boot default MVC configuration by providing your own `@EnableWebMvc` configuration, you can take control completely and do everything manually by using `getMessageConverters` from `WebMvcConfigurationSupport`.
138+
Finally, if you opt out of the default Spring Boot MVC configuration by providing your own `@EnableWebMvc` configuration, you can take control completely and do everything manually by using `getMessageConverters` from `WebMvcConfigurationSupport`.
139139

140140
See the {spring-boot-autoconfigure-module-code}/web/servlet/WebMvcAutoConfiguration.java[`WebMvcAutoConfiguration`] source code for more details.
141141

@@ -152,7 +152,7 @@ The multipart support is helpful when you want to receive multipart encoded file
152152

153153
See the {spring-boot-autoconfigure-module-code}/web/servlet/MultipartAutoConfiguration.java[`MultipartAutoConfiguration`] source for more details.
154154

155-
NOTE: It is recommended to use the container's built-in support for multipart uploads rather than introducing an additional dependency such as Apache Commons File Upload.
155+
NOTE: It is recommended to use the container's built-in support for multipart uploads rather than introduce an additional dependency such as Apache Commons File Upload.
156156

157157

158158

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/testing.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ include::{docs-java}/howto/testing/slicetests/MySecurityConfiguration.java[]
4646
include::{docs-java}/howto/testing/slicetests/MyDatasourceConfiguration.java[]
4747
----
4848

49-
Having a single configuration class can be inefficient when beans of a certain domain need to be included in slice tests.
49+
Having a single configuration class can be inefficient when beans from a certain domain need to be included in slice tests.
5050
Instead, structuring the application's configuration as multiple granular classes with beans for a specific domain can enable importing them only for specific slice tests.
5151

0 commit comments

Comments
 (0)