Commit Graph

3393 Commits

Author SHA1 Message Date
Phillip Webb dcb41b03a0 Merge branch '2.7.x' into 3.0.x
Closes gh-34617
2023-03-15 15:09:44 -07:00
Phillip Webb aea57fbd41 Consider the underling file in equals/hashcode
Update `StandardConfigDataResource` so that the underlying file is
considered in equals/hashcode. Prior to this commit, if the classpath
included `.` then the same resource could be loaded twice. Once via
a `ClassPathResource` and once via a `FileSystemResource`.

Fixes gh-34212
2023-03-15 13:52:10 -07:00
Phillip Webb 5d21c3616f Don't treat Kotlin data classes as immutable
Unlike records, Kotlin data classes are mutable and so we can't apply
the same constructor detection logic.

Fixes gh-34500
2023-03-14 18:03:15 -07:00
Andy Wilkinson 3945c48290 Merge branch '2.7.x' into 3.0.x
Closes gh-34515
2023-03-08 17:28:10 +00:00
Andy Wilkinson 86c988d653 Improve compatibility with SnakeYAML 2.0
Closes gh-34405
2023-03-08 17:25:42 +00:00
Moritz Halbritter 7ea56a2fdb Merge branch '2.7.x' into 3.0.x
Closes gh-34419
2023-03-01 12:51:15 +01:00
1993heqiang 277784b17d Update logger to use GracefulShutdown.class
See gh-34220
2023-03-01 12:50:31 +01:00
Phillip Webb 285097d746 Bind nested record types even if they have an existing value
Update logic in `DefaultBindConstructorProvider` introduced in commit
84b13f0748 so that record types are always bound.

Fixes gh-34407
2023-02-28 14:55:43 -08:00
Andy Wilkinson 72de4a8937 Use ResourceLoader's ClassLoader to load ConfigDataLoaders
Fixes gh-34372
2023-02-24 16:10:49 +00:00
Phillip Webb 0b15962aca Merge branch '2.7.x' into 3.0.x 2023-02-22 18:36:16 -08:00
Phillip Webb 1132b5e8a5 Merge branch '2.7.x' into 3.0.x 2023-02-22 12:40:23 -08:00
Phillip Webb b126c33195 Enable and fix ImportCandidatesTests 2023-02-22 12:39:00 -08:00
Andy Wilkinson 31b1c3e8ad Replace property placeholders in Logback component class names
Closes gh-34336
2023-02-22 19:47:41 +00:00
Phillip Webb e04c09ceae Merge branch '2.7.x' into 3.0.x 2023-02-22 00:50:18 -08:00
Phillip Webb 891ce3bd1b Disable recently renamed tests 2023-02-22 00:49:23 -08:00
Phillip Webb 01e8c42c16 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:55:34 -08:00
Phillip Webb 3651ba348d Fix checkstyle test violations 2023-02-21 23:49:56 -08:00
Phillip Webb c4de86c244 Merge branch '2.7.x' into 3.0.x 2023-02-21 23:17:57 -08:00
Phillip Webb df5898a146 Reformat code following spring-javaformat upgrade 2023-02-21 22:53:27 -08:00
Andy Wilkinson bc19e398ba Report Logback configuration errors when running in a native image
Closes gh-34315
2023-02-21 16:10:26 +00:00
Andy Wilkinson a0de59c209 Fix property binding to Kotlin data class in a native image
Fixes gh-34157
2023-02-13 14:49:04 +00:00
Johnny Lim bc7fc90550 Replace Base64Utils with JDK's Base64
See gh-33967
2023-01-31 10:20:06 +01:00
Krzysztof Krason f4af93fb03 Use for loop rather than iterator
See gh-33987
2023-01-26 20:47:35 -08:00
Krzysztof Krason 55a50d565c Use Comparator.comparing
See gh-33987
2023-01-26 20:47:34 -08:00
Krzysztof Krason d3efd7e091 Use try with close
See gh-33987
2023-01-26 20:36:38 -08:00
Krzysztof Krason 0e68cae57f Use instanceof patterns
See gh-33987
2023-01-26 20:36:25 -08:00
Krzysztof Krason 6e46423983 Use diamond operators
See gh-33987
2023-01-26 20:35:08 -08:00
Phillip Webb 0a50b83c75 Add DataSourceBuilderRuntimeHints
Add hints for DataSourceBuilderRuntime.

Closes gh-33692
2023-01-19 10:52:34 -08:00
Moritz Halbritter ae79c60619 Remove instance suppliers in bean definitions
Remove instance suppliers in bean definitions and depend instead
on reflection. This allows the AOT engine to correctly process
the definitions.

Fixes gh-33763
2023-01-18 19:55:56 -08:00
Phillip Webb 71efc55bf9 Merge branch '2.7.x' 2023-01-18 16:31:53 -08:00
Phillip Webb 7c508fa324 Update copyright year of changed files 2023-01-18 15:37:58 -08:00
Moritz Halbritter 94f4a4396c Merge branch '2.7.x'
Closes gh-33880
2023-01-18 17:35:52 +01:00
Moritz Halbritter e8d809fe65 Replace 'via' with 'over' or 'through' in the documentation
Closes gh-33878
2023-01-18 16:56:42 +01:00
Andy Wilkinson a2f593c15f Merge branch '2.7.x'
Closes gh-33876
2023-01-18 14:02:56 +00:00
Andy Wilkinson b5cebed120 Improve failure description when bean def has no resource description
Closes gh-33765
2023-01-18 13:52:56 +00:00
Moritz Halbritter c939e27925 Only set AWT headless property if not already set
Closes gh-28803
2023-01-18 14:28:26 +01:00
Phillip Webb fad88232b9 Update copyright year of changed files 2023-01-17 10:12:38 -08:00
Phillip Webb a889c539ab Merge branch '2.7.x' 2023-01-17 10:12:25 -08:00
Phillip Webb a0fe8241a7 Update copyright year of changed files 2023-01-17 10:07:03 -08:00
Moritz Halbritter 47c1aa2724 Merge branch '2.7.x'
Closes gh-33771
2023-01-12 09:48:21 +01:00
Moritz Halbritter d6f682da7e Polish JavaBeanBinder
Closes gh-33762
2023-01-12 09:45:36 +01:00
Moritz Halbritter e45b47565c Use Threadlocal.remove instead of .set(null)
See https://github.com/spring-cloud/spring-cloud-sleuth/issues/27 for
reference.
2023-01-11 11:38:48 +01:00
Phillip Webb 84b13f0748 Refine constructor detection logic when binding to existing values
Update `DefaultBindConstructorProvider` so that deduced constructors
are not used if there is an existing value.

Prior to this commit, constructor detection logic was not compatible
with earlier versions of Spring Boot. With Spring Boot 3.0.1, given
a class of the following form:

	@ConfigurationProperties(prefix = "example")
	public class ExampleProperties {

	    @NestedConfigurationProperty
	    private final NestedProperty nested = new NestedProperty(
	    		"Default", "default");

	    public NestedProperty getNested() {
	        return nested;
	    }

	}

If `NestedProperty` has a single constructor with arguments, constructor
binding would be used. In Spring Boot 2.x, setter injection would have
been used.

The updated code now only uses constructor injection if an explicit
`@ConstructorBinding` annotation is present, or if there is no existing
value.

Fixes gh-33409
See gh-33710
2023-01-09 16:57:56 -08:00
Phillip Webb a2ac38e203 Update copyright year of changed files 2023-01-09 15:46:07 -08:00
Phillip Webb 80cfcb71ec Update copyright year of changed files 2023-01-09 15:18:10 -08:00
Krzysztof Krason cf6493f65c Simplify AssertJ assertions and also make them more readable
See gh-33653
2023-01-09 11:10:20 +01:00
Kaveh Shamsi 2d95e4a31e Fix JavaDoc typo in LocalServerPort
See gh-33683
2023-01-09 10:27:40 +01:00
Phillip Webb 2e90b71c30 Do not attempt constructor binding for items with an existing value
Update `DefaultBindConstructorProvider` so that it no longer detects
constructors when the `Bindable` has an existing value. This update
allows us change `ConfigurationPropertiesBindingPostProcessor` and
related classes so that all instances created from `@Bean` methods
are treated as `JAVA_BEAN` bindings and will not be accidentally
re-created using constructor binding.

Fixes gh-33710
2023-01-06 17:23:03 -08:00
Phillip Webb f588793445 Update copyright year of changed files 2022-12-22 01:00:42 -08:00
Phillip Webb 0254619782 Merge branch '2.7.x' 2022-12-22 00:59:40 -08:00