Commit Graph

1300 Commits

Author SHA1 Message Date
Sam Brannen 41ae9632d1 Upgrade to Checkstyle 9.0 and spring-javaformat 0.0.29
This commit upgrades the Gradle build to use Checkstyle 9.0 and
spring-javaformat 0.0.29 (which internally uses Checkstyle 8.45.1).

Closes gh-27520
2021-10-06 12:11:19 +02:00
Sam Brannen 48a507a993 Clean up warnings 2021-10-05 14:35:32 +02:00
Juergen Hoeller f632165dec Invoke bean-derived (Auto)Closeable.close() method directly
Closes gh-27504
2021-10-01 13:26:25 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Sam Brannen bfdc99ab79 Fix Javadoc errors
See gh-27480
2021-09-28 11:44:12 +02:00
Sam Brannen 2567b20949 Upgrade to spring-javaformat 0.0.28 and downgrade to Checkstyle 8.41
In order to be able to use text blocks and other new Java language
features, we are upgrading to a recent version of Checkstyle.

The latest version of spring-javaformat-checkstyle (0.0.28) is built
against Checkstyle 8.32 which does not include support for language
features such as text blocks. Support for text blocks was added in
Checkstyle 8.36.

In addition, there is a binary compatibility issue between
spring-javaformat-checkstyle 0.0.28 and Checkstyle 8.42. Thus we cannot
use Checkstyle 8.42 or higher.

In this commit, we therefore upgrade to spring-javaformat-checkstyle
0.0.28 and downgrade to Checkstyle 8.41.

This change is being applied to `5.3.x` as well as `main` in order to
benefit from the enhanced checking provided in more recent versions of
Checkstyle.

Closes gh-27481
2021-09-28 10:29:31 +02:00
Juergen Hoeller 211f0bbf88 Fix invalid characters in source files
Closes gh-27475
2021-09-27 16:57:54 +02:00
Juergen Hoeller 9ff0d717f2 Restore lenient fallback in case of several non-public constructors
See gh-27437
2021-09-27 16:52:11 +02:00
Juergen Hoeller 58898de542 Provide accessors for externallyManagedConfigMembers and Init/DestroyMethods
Closes gh-27449
2021-09-23 15:54:40 +02:00
Juergen Hoeller f9d63e7bb1 BeanUtils.getResolvableConstructor falls back to single non-public constructor
Closes gh-27437
2021-09-23 15:53:54 +02:00
Sam Brannen f07e6a1b9d Support char primitive default values in BeanUtils.instantiateClass()
Closes gh-27390
2021-09-14 16:12:21 +02:00
Sam Brannen 5cc09849ce Introduce test for gh-27390 2021-09-14 16:05:41 +02:00
takeaction21 92cd680a2c Support float and double primitive default values in BeanUtils.instantiateClass()
See gh-27390
2021-09-14 16:05:41 +02:00
Juergen Hoeller 6c17e9375b Reduce log statement for non-unique JavaBean property to debug level
Closes gh-27372
2021-09-13 18:13:41 +02:00
Brian Clozel cecc0849a8 Upgrade to Gradle 7.2
This commit upgrades Gradle to 7.2.
Gradle configuration names are updated accordingly.
This also upgrades Gradle build plugins.

See gh-26870
2021-09-13 09:37:35 +02:00
Juergen Hoeller b2eaa7c1c3 Polishing 2021-09-02 22:59:33 +02:00
Juergen Hoeller b6c2c11805 Polishing 2021-09-02 22:21:27 +02:00
Sam Brannen 6177f00a63 Polish PropertyAccessor tests 2021-08-18 17:10:40 +02:00
Juergen Hoeller 44951873f9 Introduce accessors for allowCircularReferences/allowRawInjectionDespiteWrapping
Closes gh-27289
2021-08-17 17:19:21 +02:00
Stephane Nicoll 31b651a114 Polish contribution
See gh-27248
2021-08-08 11:33:26 +02:00
Syuziko eaf9deedfd Polish tests
See gh-27248
2021-08-07 18:53:47 +02:00
Stephane Nicoll a90ed957be Support ResolvableType in BeanDefinitionBuilder
Closes gh-27160
2021-07-12 14:07:25 +02:00
Johnny Lim 925edf28fc Add Javadoc since to BeanDefinitionBuilder.setSynthetic()
See gh-27155
2021-07-12 08:22:09 +02:00
diguage 564c6f7f86 improve the performance of iteration 2021-07-09 15:10:18 +02:00
Juergen Hoeller 8680fdb8bc Polishing 2021-07-09 13:26:46 +02:00
Juergen Hoeller 74f91339e2 BeanCreationException message includes declaring class of constructor/factory method
Closes gh-27139
2021-07-09 13:22:50 +02:00
Stephane Nicoll fed1a426b6 Improve BeanDefinitionBuilder to handle the synthetic flag
Closes gh-27141
2021-07-07 16:13:19 +02:00
Stephane Nicoll cf78895ba0 Polish 2021-07-07 16:11:48 +02:00
Sam Brannen a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Juergen Hoeller 4bb88f3b1d Remove logging dependency in BeanUtils
Closes gh-27070
2021-06-22 15:26:48 +02:00
Sam Brannen 29fa9c1728 Polish contribution
See gh-27034
2021-06-08 17:52:07 +02:00
Beca-se 39660710f6 Cross-ref additional *Aware APIs in BeanFactory Javadoc
Closes gh-27034
2021-06-08 17:47:47 +02:00
Sam Brannen f0f450a18d Polishing 2021-06-07 13:24:46 +02:00
Juergen Hoeller b3dcb64ff1 Generic bean type resolution for lookup methods
Closes gh-26998
2021-05-28 17:23:52 +02:00
Sam Brannen ffbc537835 Polish ConcurrentBeanWrapperTests 2021-05-23 18:50:50 +02:00
Elvys Soares 9295bcc4a4
Refactor ConcurrentBeanWrapperTests to use @RepeatedTest
Closes gh-26968
2021-05-23 18:40:36 +02:00
Florian Kirmaier b5d6e53e50 Avoid memory leak when PropertyComparator is reused
This commit fixes a potential memory leak, since PropertyComparator
previously kept an indirect reference to the value it last compared.

Closes gh-26869
2021-04-30 15:08:32 +02:00
Sam Brannen 5d297c6387 Polishing 2021-04-16 11:44:48 +02:00
Juergen Hoeller e05b584623 Ignore testWindowsAbsoluteFilePath exception if not on Windows
See gh-26702
2021-04-12 23:46:27 +02:00
Juergen Hoeller 4b6b12bf2f Bypass root path resolution for "file:" prefix only
Closes gh-26702
2021-04-12 22:40:53 +02:00
Brian Clozel a8d553218c Introduce Gradle Toolchain support in build
Prior to this commit, the Spring Framework build would rely on
setting a custom Java HOME for building all sources and tests
with that JDK.

This approach is not flexible enough, since we would be testing
the source compatibility against a recent JDK, but not a common
case experienced by the community: compiling and running
application code with a recent JDK and the official, JDK8-based
Framework artifacts.
This method is also limiting our choice of JDKs to the ones
currently supported by Gradle itself.

This commit introduces the support of Gradle JVM Toolchains in
the Spring Framework build.

We can now select a specific JDK for compiling the main
SourceSets (Java, Groovy and Kotlin) and another one for
compiling and running the test SourceSets:

`./gradlew check -PmainToolChain=8 -PtestToolchain=15`

Gradle will automatically find the JDKs present on the host or
download one automcatically. You can find out about the ones
installed on your host using:

`./gradlew -q javaToolchains`

Finally, this commit also refactors the CI infrastructure to:

* only have a single CI image (with all the supported JDKs)
* use this new feature to compile with JDK8 but test it
against JDK11 and JDK15.

Closes gh-25787
2021-03-15 14:33:41 +01:00
drgnchan bc261fd995
Remove duplicate word in Javadoc
Closes gh-26676
2021-03-15 11:47:17 +01:00
Juergen Hoeller 530fb0808d Polishing 2021-03-08 23:45:56 +01:00
Juergen Hoeller b5147a034c Polishing
See gh-26574
See gh-26575
2021-02-25 18:08:04 +01:00
Craig Andrews ebf6fff312 Fix handling of file: paths to non-existent files
For setAsText, if the text argument is a file: URL for a path that does not exist, Paths.get(text) is called where text is a file: URL, which doesn't work - the result is an InvalidPathException.

To fix this issue, also check that the resource isn't a file before calling Paths.get(). That way, resources that are files skip to the other branch.
2021-02-25 17:55:55 +01:00
Sam Brannen 8baf404893 Polish contribution
See gh-26600
2021-02-25 11:41:11 +01:00
nullzl a33eac3ec0 Correctly set auto-growing array's element
Prior to this commit, the implementation of processKeyedProperty() in
AbstractNestablePropertyAccessor resulted in a
`java.lang.IllegalArgumentException: array element type mismatch` when
the property expression had more than one property key and the last key
should cause the array to grow automatically.

For example, given a property `int[][] multiArray` and property
expression `multiArray[1][3]`, the `processKeyedProperty()` method
created a new array object and assigned it to `multiArray`; whereas,
the new array object should have be assigned to `multiArray[1]`.

This commit fixes this issue.

Closes gh-26600
2021-02-25 11:25:54 +01:00
Sam Brannen a78c12b8d3 Fix Javadoc for PlaceholderConfigurerSupport 2021-02-22 17:02:01 +01:00
Sébastien Deleuze 3524401bf1 Introduce a NativeDetector utility class
With the introduction of the -H:+InlineBeforeAnalysis native image
compiler flag in GraalVM 21.0.0, it is now possible to use an utility method and get code
removal at build time.

This flag will be enabled as of Spring Native 0.9.0.

closes gh-25795
2021-02-15 16:36:23 +01:00
Juergen Hoeller df977a2fd2 Nullability refinements and related polishing 2021-02-14 17:57:32 +01:00