Skip to content

Commit f7678cd

Browse files
committed
Polish core-beans.adoc
1 parent 3ab39ed commit f7678cd

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/docs/asciidoc/core/core-beans.adoc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ injection:
923923
public class SimpleMovieLister {
924924
925925
// the SimpleMovieLister has a dependency on a MovieFinder
926-
private MovieFinder movieFinder;
926+
private final MovieFinder movieFinder;
927927
928928
// a constructor so that the Spring container can inject a MovieFinder
929929
public SimpleMovieLister(MovieFinder movieFinder) {
@@ -943,7 +943,7 @@ injection:
943943
----
944944

945945
Notice that there is nothing special about this class. It is a POJO that
946-
has no dependencies on container specific interfaces, base classes or annotations.
946+
has no dependencies on container specific interfaces, base classes, or annotations.
947947

948948
[[beans-factory-ctor-arguments-resolution]]
949949
===== Constructor Argument Resolution
@@ -974,10 +974,10 @@ being instantiated. Consider the following class:
974974
class ThingOne(thingTwo: ThingTwo, thingThree: ThingThree)
975975
----
976976

977-
Assuming that `ThingTwo` and `ThingThree` classes are not related by inheritance, no potential
978-
ambiguity exists. Thus, the following configuration works fine, and you do not need to specify
979-
the constructor argument indexes or types explicitly in the `<constructor-arg/>`
980-
element.
977+
Assuming that the `ThingTwo` and `ThingThree` classes are not related by inheritance, no
978+
potential ambiguity exists. Thus, the following configuration works fine, and you do not
979+
need to specify the constructor argument indexes or types explicitly in the
980+
`<constructor-arg/>` element.
981981

982982
[source,xml,indent=0,subs="verbatim,quotes"]
983983
----
@@ -1006,10 +1006,10 @@ by type without help. Consider the following class:
10061006
public class ExampleBean {
10071007
10081008
// Number of years to calculate the Ultimate Answer
1009-
private int years;
1009+
private final int years;
10101010
10111011
// The Answer to Life, the Universe, and Everything
1012-
private String ultimateAnswer;
1012+
private final String ultimateAnswer;
10131013
10141014
public ExampleBean(int years, String ultimateAnswer) {
10151015
this.years = years;
@@ -1031,7 +1031,7 @@ by type without help. Consider the following class:
10311031
.[[beans-factory-ctor-arguments-type]]Constructor argument type matching
10321032
--
10331033
In the preceding scenario, the container can use type matching with simple types if
1034-
you explicitly specify the type of the constructor argument by using the `type` attribute.
1034+
you explicitly specify the type of the constructor argument by using the `type` attribute,
10351035
as the following example shows:
10361036

10371037
[source,xml,indent=0,subs="verbatim,quotes"]
@@ -1251,7 +1251,8 @@ visibility of some configuration issues is why `ApplicationContext` implementati
12511251
default pre-instantiate singleton beans. At the cost of some upfront time and memory to
12521252
create these beans before they are actually needed, you discover configuration issues
12531253
when the `ApplicationContext` is created, not later. You can still override this default
1254-
behavior so that singleton beans initialize lazily, rather than being pre-instantiated.
1254+
behavior so that singleton beans initialize lazily, rather than being eagerly
1255+
pre-instantiated.
12551256

12561257
If no circular dependencies exist, when one or more collaborating beans are being
12571258
injected into a dependent bean, each collaborating bean is totally configured prior

0 commit comments

Comments
 (0)