Commit Graph

991 Commits

Author SHA1 Message Date
Stephane Nicoll 927c2cacfa Rework type generation algorithm
The initial solution to gh-11512 was still using a plain `toString` that
could potentially break with a JDK upgrade. Turns out that JDK9 actually
uses the same type for AnnotatedType and ClassType so the trick of using
a visitor doesn't work anymore.

Retrospectively, it is quite easy to generate the full type once we have
the DeclaredType as we already have some logic to get the qualified,
that is raw, type and we have access to the type parameters.

This commit still uses a `toString` to generate the representation of
the type parameters but this looks much safer than trying to redo what
such a simple `toString` should do. Also, the additional metadata that
we could get on an ExecutableElement does not apply to them.

Closes gh-11512
2018-01-18 13:52:12 +01:00
Stephane Nicoll d8b1f1692a Fix type detection with annotated getter
This commit makes sure that the `type` of a property is generated
property if the getter of the property is annotated. Previously, a type
implementation may expose the annotation information.

Closes gh-11512
2018-01-17 13:30:57 +01:00
Phillip Webb 700d3c3907 Relocate shaded JSON API in annotation-processor
Move the 'shade' copy of the JSON API to a separate src folder to make
it clearer that we don't own the code. Also polished some formatting
and suppressed a few warnings.

Closes gh-10307
2018-01-08 12:24:19 -08:00
Stephane Nicoll b9f4fd0b65 Fix exclude filter to not exclude MediaType
This commit removes MediaType from the list of exclude types as it looks
like an error: MediaType has a constructor taking a `String` and binding
works fine with it.

This has the effect of properly generating the metadata for the only key
that Spring Boot exposes with a MediaType type:
spring.data.rest.default-media-type.

Closes gh-11568
2018-01-08 17:44:32 +01:00
Stephane Nicoll 4568f14c71 Fix javadoc warnings 2018-01-08 15:55:24 +01:00
Stephane Nicoll d49b022ce3 Shade json in configuration processor
This commit shades the json API in the configuration processor so that
it doesn't bring `android-json` to the classpath anymore.

Closes gh-10307
2018-01-04 10:10:56 +01:00
Stephane Nicoll 397d3e85e8 Fix Windows build
Closes gh-11459
2018-01-02 15:45:43 +01:00
Douglas Cardoso feecc27677 Log inaccessible file in RandomAccessDataFile
Closes gh-11401
2017-12-28 11:25:51 +01:00
Phillip Webb 2c429ba77d Restore static final formatting
Restore static final constants to upper case formatting.

See gh-10457
2017-12-13 12:21:57 -08:00
Phillip Webb 6a55623910 Polish 2017-12-13 12:21:57 -08:00
dreis2211 d5370e6852 Precompile current dir pattern in Handler
Closes gh-11321
2017-12-12 12:54:01 +00:00
dreis2211 37437a0fe2 Avoid allocations from lower-casing spec in JAR Handler
Closes gh-11314
2017-12-11 23:34:18 +01:00
Stephane Nicoll 846e642631 Properly handle class reference
Previously, a condition on a class targeting an inner class would
generate an invalid String representation of it. Unfortunately, the
`toString` representation misses the `$` sign between the outer class
and the inner class name.

This commit post-processes the values to generate the appropriate
representation.

Closes gh-11282
2017-12-07 09:42:12 -08:00
Andy Wilkinson a491727b7c Avoid creating unnecessary garbage during URL normalization
Closes gh-11207
2017-11-29 20:33:02 +00:00
Sylwester Lachiewicz 0a6f5fb2be Update Apache Maven Central repository url
Closes gh-11190
2017-11-29 14:19:15 +01:00
Spring Buildmaster df2ae7aa19 Next Development Version 2017-11-28 09:55:46 +00:00
Stephane Nicoll 373f7db3b5 Add missing supported source version
Closes gh-10929
2017-11-07 08:44:40 +01:00
dreis2211 605e95145a Fix typos in ApplicationArguments and Library
Closes gh-10811
2017-10-30 16:30:56 +01:00
Johnny Lim 4979af9fa5 Remove unnecessary assignments
Closes gh-10805
2017-10-29 14:07:00 +01:00
Spring Buildmaster c0f9f64776 Next Development Version 2017-10-16 12:36:43 +00:00
Johnny Lim bfa291f671 Polish 2017-10-02 15:07:03 +01:00
Spring Buildmaster 30eb937a83 Next Development Version 2017-09-12 10:54:22 +00:00
Stephane Nicoll af18110226 Polish "Improve exception message for invalid source"
Closes gh-10130
2017-09-07 09:43:21 +02:00
Aurélien Pupier 44b60c72e3 Improve exception message for invalid source
See gh-10130
2017-09-07 09:42:54 +02:00
Andy Wilkinson 7a87c69dd0 Normalize spec when creating jar URL by removing /../ and /./
Previously when Handler was creating a URL from a context URL and a
spec, any occurrances of /../ or /./ in the spec would be left as-is.
This differed from the JDK's Handler implementation which normalizes
the URL by modifying the path to remove any occurrences of /../ or
/./

This commit updates our Handler implementation to align it with the
JDK's. Tests have been added to assert that, given the same inputs,
the two Handler classes produce the same output.

Closes gh-9917
2017-08-03 19:48:58 +01:00
Andy Wilkinson b7ac5f2eb2 Polish "Make JarURLConnection return entry's last modified time"
Closes gh-9893
2017-07-28 15:41:34 +01:00
rostislav.dudka 7c7259beec Make JarURLConnection return entry's last modified time
See gh-9893
2017-07-28 15:41:29 +01:00
Spring Buildmaster 17a5bb0be4 Next development version 2017-07-27 08:00:21 +00:00
Spring Buildmaster 41c5c0e7c9 Next development version 2017-07-26 08:30:55 +00:00
Andy Wilkinson e0be40cd94 Polish "Locate additional metadata when using Gradle 4"
Closes gh-9732
2017-07-25 16:48:46 +01:00
Misagh Moayyed 980b83c0d8 Locate additional metadata when using Gradle 4
Closes gh-9758
2017-07-25 16:48:27 +01:00
Phillip Webb 28dad44e2d Be defensive about JUL calls from JAR Handler
Update nested JAR support to only obtain JUL loggers when absolutely
necessary and to defensively deal with failures.

Prior to this commit it was not possible to override
`java.util.logging.manager` to use a nested JAR as the logger
implementation.

Fixes gh-9848
2017-07-24 12:54:24 -07:00
Stephane Nicoll 11fb792e88 Fix source repository links in maven plugin site
Closes gh-9671
2017-07-09 14:43:32 +02:00
Phillip Webb aa57ca7e18 Polish 2017-07-06 16:53:04 -07:00
Stephane Nicoll d77056639d Add a warning about fully executable archive
Closes gh-9574
2017-06-22 10:49:01 +02:00
Andy Wilkinson e6a3ca5da6 Address deprecation warning that's generated by Gradle 4.x
In Gradle 4.x, SourceSetOutput now has multiple classes directories
and getClassesDir() has been deprecated. This commit introduces the
use of reflection to use getClassesDirs() when it's available rather
than getClassesDir().

Closes gh-9559
2017-06-21 12:52:05 -07:00
Andy Wilkinson 59122358d3 Clean up and format code 2017-06-16 08:58:14 +01:00
Stephane Nicoll acda4f905f Add support for deprecation level
This commit ensures that deprecation level set in manual metadata is
properly merged in the generated one.

Closes gh-9449
2017-06-14 09:28:59 +02:00
Andy Wilkinson 2d3bcae4e1 Make JarURLConnection return entry's length from getContentLengthLong()
Closes gh-9484
2017-06-12 13:46:59 +01:00
Spring Buildmaster 05d4d0281c Next Development Version 2017-06-08 12:47:16 +00:00
Andy Wilkinson 5c708ae712 Merge branch '1.4.x' into 1.5.x 2017-06-01 11:04:23 +01:00
Andy Wilkinson 5b4f9edc86 Restore original TCCL in PropertiesLauncherTests
Calling launch of PropertiesLauncherTests sets the thread context
class loader to an instance of LaunchedURLClassLoader. To avoid this
class loader being used beyond the scope of the test and launcher
that created it, this commit updates PropertiesLauncherTests to
capture the TCCL before each test and restore it after each test.

Closes gh-9378
2017-06-01 10:58:00 +01:00
Andy Wilkinson c22230a418 Try making FilePool static to fix the Mockito problem on Bamboo 2017-05-31 23:24:03 +01:00
Andy Wilkinson e11b7aff08 Ensure that file is released back to pool when seek fails
Closes gh-9370
2017-05-31 21:50:05 +01:00
Stephane Nicoll 9b2ad6100e Fix reference of custom layout example
Closes gh-9342
2017-05-29 14:56:14 +02:00
Andy Wilkinson f7127e5522 Ensure that closing a JarFile closes all underlying resources
Closes gh-8871
2017-05-23 20:42:59 +01:00
Phillip Webb 74f411faed Formatting 2017-05-15 15:58:30 -07:00
Stephane Nicoll cdf5f6e0ee Add support for deprecation level in manual metadata
This commit allows to specify a deprecation level to a manual metadata
entry. The purpose of that new attribute is to distinguish cases where
the property is still bound (default) from cases where the property no
longer exists and won't be bound.

This gives the opportunity to IDEs to still show the property as an
error and offer documentation and an action to rename it if a
replacement exists.

Closes gh-9074
2017-05-15 12:39:15 +03:00
Stephane Nicoll 643dea18ee Accommodate with Lombok generation ordering
Previously, if lombok was running before the configuration metadata
annotation processor, duplicated keys were created as both the
getter/setter and the special lombok handling applied.

This commit makes sure to be lenient by removing duplicate metadata
entries. This commit also makes sure to identify the getter of a
nested group if present. That way, the sourceMethod is set consistently
and avoid the creation of a duplicate group.

Closes gh-8886
2017-05-12 16:48:31 +02:00
Stephane Nicoll ea4e6fea35 Polish 2017-05-09 09:37:30 +02:00