295 Commits

Author SHA1 Message Date
Andy Wilkinson
62aa8ce107 Support incremental annotation processing with Gradle
Closes gh-22150
2020-06-30 11:27:32 +01:00
Phillip Webb
82ed255bb1 Merge branch '2.3.x'
Closes gh-22060
2020-06-22 12:14:58 -07:00
Phillip Webb
9843888714 Merge branch '2.2.x' into 2.3.x
Closes gh-22059
2020-06-22 12:14:35 -07:00
Phillip Webb
3b3a49db1f Polish 'Fix infinite loop in FieldValues'
See gh-22040
2020-06-22 12:01:04 -07:00
Konrado85
39a853c57b Fix infinite loop in FieldValues
Update `FieldValues` test object so that it doesn't cause an infinite
loop if it is actually created.

See gh-22040
2020-06-22 11:58:22 -07:00
Andy Wilkinson
47874d8c6a Treat warnings as errors when compiling
See gh-21271
2020-06-16 12:50:41 +01:00
Phillip Webb
0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Phillip Webb
5ae623c43a Polish 'Add Period converter support'
Polish period converter support, primarily by changing
`PeriodStyle` to parse and print periods that include
more than one unit.

See gh-21136
2020-05-06 00:21:50 -07:00
Grubhart
dc4d71f91e Add Period converter support
Add converter support for `javax.time.Period` including:

	String -> Period
	Number -> Period
	Period -> String

Period to Number conversion is not supported since `Period` has no
ability to deduce the number of calendar days in the period.

See gh-21136
2020-05-05 22:31:49 -07:00
Phillip Webb
ad1248e4ec Replace "folder" with "directory"
Consistently use the term "directory" instead of "folder"

Closes gh-21218
2020-04-28 19:20:24 -07:00
Phillip Webb
bf41da5322 Update copyright year of changed files 2020-04-21 18:12:27 -07:00
Stephane Nicoll
692885f71e Merge branch '2.2.x'
Closes gh-21049
2020-04-21 16:00:41 +02:00
Stephane Nicoll
8cbd7f5cd0 Polish "Add support for initializing nested object when nothing bound"
This commit harmonizes the change made to @DefaultValue to the
annotation processor. If such annotation is added to a scalar value with
no value at all, no default value is produced.

Closes gh-18917
2020-04-21 15:59:34 +02:00
Phillip Webb
3ca896e63f Polish 2020-04-07 12:10:49 -07:00
dreis2211
9588188800 Use isEmpty() where possible
See gh-20370
2020-03-03 18:33:26 -05:00
Stephane Nicoll
95be419527 Use Class.forName rather than ClassLoader.loadClass
This commit changes uses of ClassLoader.loadClass to Class.forName for
consistency with what was initiated in #19342 and better compatibility
with GraalVM.

Closes gh-19824
2020-01-23 10:47:53 +01:00
Phillip Webb
e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
2020-01-22 16:02:38 -08:00
Phillip Webb
0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
2020-01-22 15:49:52 -08:00
Andy Wilkinson
ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
2020-01-10 14:15:35 +00:00
Stephane Nicoll
2c1e81adf0 Polish 2019-12-26 10:42:40 +01:00
Stephane Nicoll
b3643965f0 Polish "Detect config props using builder pattern and generics"
See gh-19099
2019-12-23 14:57:48 +01:00
如梦技术
743f4a4cb1 Detect config props using builder pattern and generics
See gh-19099
2019-12-23 14:54:00 +01:00
Phillip Webb
26ff18f37d Merge branch '2.1.x' into 2.2.x 2019-12-13 11:29:51 -08:00
Phillip Webb
accd830dd5 Update copyright header of changed files 2019-12-13 11:23:24 -08:00
Andy Wilkinson
f1af8c5510 Merge branch '2.1.x'
Closes gh-18889
2019-11-05 15:50:51 +00:00
Andy Wilkinson
59bc3c5602 Prevent recursive config props from causing a stack overflow
Previously, when the configuration properties annotation processor
encountered a property that was the same as an outer type that had
already been processed, it would fail with a stack overflow error.

This commit introduces the use of a stack to track the types that
have been processed. Types that have been seen before are skipped,
thereby preventing a failure from occurring. We do not fail upon
encountering a recursive type to allow metadata generation to
complete. At runtime, the recursive property will not cause a problem
if it is not bound.

Fixes gh-18365
2019-11-05 15:35:11 +00:00
Johnny Lim
45d85778b8 Polish
See gh-18838
2019-11-01 09:01:24 +02:00
Stephane Nicoll
d6d32ec01d Polish 2019-10-29 09:02:25 +01:00
Phillip Webb
386c0a60a7 Relax @ConstructorBinding member class requirement
Update `@ConfigurationProperties` so that `@ConstructorBinding` classes
no longer need to repeat the annotation for their members.

Closes gh-18481
2019-10-02 17:17:44 -07:00
Stephane Nicoll
45f6668d03 Use @ConstructorBinding when generating meta-data
Update the configuration processor to use the newly introduced
`@ConstructorBinding` annotation to determine when meta data
should be generated from constructor parameters.

Prior to this commit, the processor had no good way to tell when
constructor parameters should be used instead of getters/setters.

Closes gh-17035
2019-10-02 13:36:27 -07:00
Andy Wilkinson
46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
2019-10-02 10:48:57 +01:00
Andy Wilkinson
3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
2019-10-02 10:48:30 +01:00
Stephane Nicoll
39fed4a9d9 Fix binding detection of ConfigurationProperties contributed by @Bean
This commit makes sure that a ConfigurationProperties type contributed
by a `@Bean` factory method uses properties binding regardless of the
presence of a matching constructor.

`@Bean` method makes sure the user is in control and will be responsible
of creating the instance. As a result, binding of properties will not
happen there and therefore can only happen with regular JavaBean
accessors.

Closes gh-18184
2019-09-09 13:29:31 +02:00
Andy Wilkinson
4b5ebd8505 Process all non-private methods, not just public methods
Previously, the configuration processor would ignore any
@ConfigurationProperties-annotated methods that were not public. This
prevented metadata generation for package-private @Bean methods such
as those in DataSourceConfiguration's inner-classes for DBCP2, Hikari,
and Tomcat JDBC.

This commit updates the annotation processor so that it will process
any non-private method annotated with @ConfigurationProperties.

Fixes gh-18124
2019-09-04 14:26:12 +01:00
dreis2211
b4350a9d96 Remove unnecessary blank lines
See gh-18089
2019-09-03 08:48:10 +02:00
Andy Wilkinson
a4b8d2401f Merge branch '2.1.x'
Closes gh-18094
2019-09-02 14:54:48 +01:00
Andy Wilkinson
abba4fa9c9 Include exception's message in message printed by AP
Fixes gh-17974
2019-09-02 14:52:14 +01:00
Andy Wilkinson
b463acb10f Merge branch '2.1.x'
Closes gh-18093
2019-09-02 14:42:21 +01:00
Andy Wilkinson
edcaee375f Consider @Deprecated on field when determining property's deprecation
Fixes gh-17550
2019-09-02 14:39:24 +01:00
Andy Wilkinson
ab87b2a39b Polish 2019-08-19 16:05:43 +01:00
Stephane Nicoll
1c8f727864 Polish "Simplify if statements"
See gh-17785
2019-08-08 14:35:29 +02:00
SaberXu
c6c3a91f8d Simplify if statements
See gh-17785
2019-08-08 14:32:37 +02:00
Phillip Webb
2cdceb92bf Polish 2019-08-03 14:29:20 +01:00
Phillip Webb
8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb
fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb
913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Phillip Webb
01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb
a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Phillip Webb
605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb
92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00