Commit Graph

103 Commits

Author SHA1 Message Date
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
arghya88 64c6e5b403 Fix typo
Closes gh-3610
2015-07-28 10:39:10 +02:00
Stephane Nicoll 42e230192f Polish 2015-07-24 07:19:53 +02:00
Stephane Nicoll e9a6245a44 Remove unnecessary System.out 2015-07-22 16:59:53 +02:00
Stephane Nicoll 178c690d37 Fix meta-data root attributes ordering 2015-07-22 16:59:25 +02:00
Phillip Webb e9d252e05c Add @DeprecatedConfigurationProperties annotation
Add a new @DeprecatedConfigurationProperties annotation which can be
used by the `ConfigurationMetadataAnnotationProcessor` to generating
meta-data deprecated blocks.

Fixes gh-3543
2015-07-17 14:14:37 -07:00
Phillip Webb 728e64b929 Polish 2015-07-16 12:56:49 -07:00
izeye f4589e7cc3 Fix typos
Closes gh-3504
2015-07-15 15:45:02 +02:00
Stephane Nicoll f2d32d3e98 Add support for property deprecation
Previously, an item could only have a 'deprecated' boolean flag to
indicate that the property is deprecated. It is desirable to provide an
additional description for the deprecation as well as the name of the
property to use instead.

The `deprecated` boolean flag is now supported. Instead, a `deprecated`
object can be specified with two optional attributes: `reason` to provide
an explanation for the deprecation and `replacement` to refer to the
property that should be used instead. If none of them is present, an
empty deprecation object should be set.

For backward compatibility, the `deprecated` field is still set.

Deprecation information can only set via manual meta-data.

Closes gh-3449
2015-07-15 15:41:52 +02:00
izeye 019140c901 Remove redundant check
Closes gh-3497
2015-07-15 09:58:15 +02:00
Phillip Webb f0f5f78e25 Polish 2015-07-14 22:17:52 -07:00
Stephane Nicoll c4c24b1f44 Detect default value from factory method
If a field is initialized via a factory method taking a single argument,
we can relatively safely consider that said argument is a good
representation of its default value. This is typically the case for
Charset or MimeType instances.

We now make sure to detect such use case (i.e. method argument with a
single argument).

Closes gh-3482
2015-07-14 15:08:43 +02:00
Phillip Webb 9ebe15232e Polish 2015-07-13 11:05:46 -07:00
Stephane Nicoll cb5eccb5c1 Add missing handle-as meta-data
Liquibase has a `changeLog` property that is definitely used as a
`Resource` but cannot be defined as such as the original String value
should be kept against an API we don't control.

Update the tests also to make it more clear that if hints are added
against a property that is detected automatically, said property still
keeps all its auto-discovered capabilities.

Closes gh-3457
2015-07-13 13:45:23 +02:00
izeye f85f316873 Polish toString()
Closes gh-3465
2015-07-13 09:52:29 +02:00
Stephane Nicoll 3664895f04 Polish 2015-07-12 09:20:12 +02:00