118 Commits

Author SHA1 Message Date
Andy Wilkinson
6920c39349 Merge branch '1.3.x' into 1.4.x 2019-03-20 15:06:50 +00:00
Andy Wilkinson
0e009ef047 Use HTTPS to link to the Apache license 2019-03-20 15:00:10 +00:00
Phillip Webb
47b00c086c Polish 2017-02-27 13:56:17 -08:00
Phillip Webb
6bc37c0589 Drop annotation processor spring-core dependency
Remove the spring-core dependency from the annotation processor.
(cherry-picked from 4cb7d86aec5)

Fixes gh-7882
2017-01-05 10:44:48 -08:00
Phillip Webb
bd74c3d327 Polish formatting 2016-12-19 12:25:09 -08:00
Andy Wilkinson
c2730ac63f Polish formatting and address warnings 2016-11-15 11:48:35 +00:00
Phillip Webb
57d5a2ebc6 Formatting 2016-10-31 11:41:45 -07:00
Stephane Nicoll
7f8849c62b Merge branch '1.3.x' into 1.4.x 2016-10-28 13:31:19 +02:00
Stephane Nicoll
5863e6f78c Fix class name in generated meta-data
Previously, the algorithm that computes the String representation of a
class reference and a property type was shared. This lead to generic
information for group's `type` and `sourceType` property.

This commit separates that logic in two: `getQualifiedName` is now
responsible to generate a fully qualified class name while the existing
`getType` is solely responsible to generate a type representation for the
property. Only the latter has generic information.

Closes gh-7236
2016-10-28 13:23:47 +02:00
Phillip Webb
266445aaf0 Polish 2016-06-29 10:44:33 -07:00
Stephane Nicoll
e9fb51bdd7 Fix test 2016-06-27 12:08:48 +02:00
Stephane Nicoll
6631136f91 Merge branch '1.3.x' 2016-06-27 12:08:04 +02:00
Stephane Nicoll
17f8a244de Fix property names with successive capital letters
Previously, if a property name had successive capital letters, the
generated meta-data would clean it in such a way it is defined as a
regular word. For instance a `myFOO` property would be written as
`my-foo` in the meta-data.

It turns out this decision is wrong as the binder has no way to compute
back the name of the property and therefore `my-foo` wouldn't bind to
`setMyFOO` as it should.

This commit updates the meta-data name generation algorithm to properly
identify such cases: `myFOO` now translates to `my-f-o-o`. While the
generated name is a bit ugly, it now provides a consistent binding
experience.

Closes gh-5330
2016-06-27 12:02:34 +02:00
Phillip Webb
7446235ff4 Polish 2016-06-20 20:13:13 -07:00
Stephane Nicoll
5407cf5f7a Prevent several registration of the same config pojo
This commit detects case where the same set of keys are exposed several
times and prevents the compilation to complete. Previously, duplicate
keys were silently added to the meta-data.

Closes gh-5939
2016-06-20 09:19:02 +02:00
Phillip Webb
e27bc9ddea Merge branch '1.3.x' 2016-06-10 17:24:02 -07:00
Phillip Webb
f27bdcb737 Prevent APT crashes on older Java versions
Update TypeUtils to guard against the use of older Java versions.
Both `Collection` and `Map` type lookups now fallback to generic free
versions of the classes.

Prior to this commit using `xmlbeans-maven-plugin` in combination with
Spring Boot's annotation processor could result in
`IllegalArgumentException: Incorrect number of type arguments`.

Fixes gh-6122
2016-06-10 17:06:45 -07:00
Phillip Webb
6575ca6ff8 Merge branch 1.3.x 2016-05-10 09:35:49 -07:00
Phillip Webb
7fb545d26c Polish 2016-05-10 09:35:10 -07:00
Stephane Nicoll
6fe9177f0d Merge branch '1.3.x' 2016-05-02 10:40:27 +02:00
Stephane Nicoll
4ccc7dc554 Ignore invalid accessors
Previously, if a void method with a single argument was named "set", the
annotation processor wrongly considered it was a setter candidate. This
commit updates the condition to ignore it.

Closes gh-5826
2016-05-02 10:38:19 +02:00
Johnny Lim
b914b4aa52 Remove the second parameter of substring() if possible
Closes gh-5720
2016-04-20 09:18:35 +02:00
Andy Wilkinson
44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00
Phillip Webb
00cfe1d054 Use AssertJ in spring-boot-tools
See gh-5083
2016-02-06 15:51:26 -08:00
Phillip Webb
2d2e4eea82 Merge branch '1.2.x' 2015-12-10 15:01:29 +00:00
Phillip Webb
2694605a4d Polish 2015-12-10 14:43:00 +00:00
Stephane Nicoll
141907c65f Merge branch '1.2.x'
# Conflicts:
#	spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java
#	spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java
2015-11-26 20:25:00 +01:00
Stephane Nicoll
ae13082e0d Generate meta-data for nested Lombok types
Closes gh-4397
2015-11-26 20:23:24 +01:00
Johnny Lim
8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00
Phillip Webb
6c2ea4648f Polish 2015-11-03 20:36:20 -08:00
Stephane Nicoll
0b326035b0 Fix detection of property setter
Previously, the meta-data annotation processor was taking the first
setter that match the property name it has to handle. Contrary to
getters that are enforced by a return type (no argument), multiple
setter candidates may exist.

If a property's type got narrowed over time, the original setter may
have been marked as Deprecated. As the annotation processor takes the
first setter that matches based on the name only, it may pick up the
deprecated one and therefore mark the property as being (wrongly)
deprecatede in the meta-data.

It turns out that checking for the actual type of the setter parameter
brought a side effect: some primitive properties may use the primitive
or the Wrapper counter part. This commit not only look at the proper
setter based on the type but also fallback on the wrapper (or) primitive
if necessary.

Closes gh-4338
2015-10-31 10:16:24 +01:00
Phillip Webb
90f7bc0321 Polish 2015-10-19 13:04:06 -07:00
Phillip Webb
634bb770b2 Organize imports with new settings
See gh-4234
2015-10-19 12:58:34 -07:00
Phillip Webb
1e4d974ec0 Merge remote-tracking branch 'local12x/1.2.x' 2015-10-19 12:56:55 -07:00
Phillip Webb
a79131f8d2 Organize imports with new settings
See gh-4234
2015-10-19 12:55:44 -07:00
Phillip Webb
c9fb9916b8 Reformat code using Eclipse Mars 2015-10-07 23:37:10 -07:00
Phillip Webb
e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb
6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Andy Wilkinson
051ebf3fac Polishing: fix a number of compiler warnings reported by Eclipse 2015-09-22 13:30:07 +01:00
Phillip Webb
e674d751de Polish Javadoc 2015-09-08 17:01:36 -07:00
Phillip Webb
e07df7e4c6 Remove redundant modifiers 2015-09-08 17:01:30 -07:00
Phillip Webb
d09805fd75 Polish license headers 2015-09-08 16:05:05 -07:00
Phillip Webb
6e29ee4557 Polish 2015-09-08 16:04:30 -07:00
Phillip Webb
67402405db Reformat code 2015-09-08 14:56:40 -07:00
Phillip Webb
0335053139 Merge branch '1.2.x' 2015-09-08 14:37:16 -07:00
Phillip Webb
15686ed4fd Reformat code 2015-09-08 14:07:06 -07:00
Phillip Webb
0f6b60d8c8 Organize imports 2015-09-08 14:05:00 -07:00
Stephane Nicoll
35875c7f08 Merge manual item meta-data
Previously, manual meta-data were added to the existing set of entries
which could lead to duplicates if a manual entry is meant to complement
a property that is detected via the processor.

We now match the name and type of the item against the auto-detected
entries. If no match is found, we add the extra entry as we did before.
If a match is found we override the description, default value and
deprecation information.

Closes gh-3562
2015-08-20 17:08:54 +02:00
Stephane Nicoll
3763eda64e Merge branch '1.2.x' 2015-08-10 16:36:11 +02:00
Stephane Nicoll
1ee31e73d3 Avoid NPE if @ConfigurationProperties is not present
The annotation processor detects `@ConfigurationProperties` bean or
method definition and merges manual meta-data. The former step will fail
with a NPE if the annotation is not present on the classpath. This could
happen if the annotation processor is added to a module that is not
actually using Spring Boot.

We now have a defensive check that skips that steps but still attempts to
merge manual meta-data if present.

Closes gh-3720
2015-08-10 16:34:30 +02:00