Previously, database initializers were detected and were configured
with dependencies based on their detection order. For example, if
detectors a, b, and c detected initializers a1, b1, b2, and c1,
c1 would depend on b2, b2 on b1, and b1 on a1:
------ ------ ------ ------
| c1 | --> | b2 | --> | b1 | --> | a1 |
------ ------ ------ ------
This could cause a dependency cycle in certain situations, for
example because the user had already configured b1 to depend on b2.
This commit reduces the risk of a cycle being created by batching
the initializers by their detector, with dependencies being
configured between each batch rather than between every initializer.
In the example above, this results in c1 depending on b1 and b2,
and b1 and b2 depending on a1:
------
------ | b1 | ------
| c1 | --> | | --> | a1 |
------ | b2 | ------
------
As b1 and b2 were detected by the same detector, no dependency
between those initializers is defined.
Closes gh-27131
Previously, when the preferred json mapper was set to Gson, the Gson
HTTP message converter was added before any other converters. This
changed the form of String responses that were already valid. When
Jackson is in use, a string converter is used as it appears earlier
in the list than the Jackson converter. When the mapper is switched
to Gson, the Gson converter is added first in the list of converters
and the Strong converter is no longer used. This results in the
String, that was already valid JSON, being converted again. This
changes its form as quotes are escaped, etc.
This commit updates HttpMessageConverters so that the Gson converter
is added to the list immediately before the default Jackson
converter. This is done by considering the Gson converter to be an
equivalent of the Jackson converter.
Fixes gh-27354