Commit Graph

2316 Commits

Author SHA1 Message Date
Sam Brannen c989cba963 Add Checkstyle rule to enforce use of class literals for primitives & void
This commit introduces a globally applied Checkstyle rule which
enforces the use of class literals for primitive types and void by
forbidding the use of the TYPE constants in Boolean, Character, Byte,
Short, Integer, Long, Float, Double, and Void.

For example, if MyClass uses one of the TYPE constants, the build will
now fail with a message similar to the following.

[ERROR] <...>/MyClass.java:39: Please use class literals for primitives and void -- for example, int.class instead of Integer.TYPE.
2024-02-01 12:51:35 +01:00
Sam Brannen 2d792f000a Polish "Apply SingleSpaceSeparator Checkstyle module"
See gh-31469
2023-10-22 14:18:18 +02:00
Johnny Lim 64e9fcad53 Apply SingleSpaceSeparator Checkstyle module
This commit also fixes its violations.

Closes gh-31469
2023-10-22 14:09:57 +02:00
Stéphane Nicoll 5c6232e681 Polish "Order modifiers to align with JLS"
See gh-31368
2023-10-17 16:16:58 +02:00
Johnny Lim 919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Sam Brannen 39a282e463 Introduce @⁠DisabledInAotMode in the TestContext framework
This commit introduces @⁠DisabledInAotMode in the TestContext
framework to support the following use cases.

- Disabling AOT build-time processing of a test ApplicationContext --
  applicable to any testing framework (JUnit 4, JUnit Jupiter, etc.).

- Disabling an entire test class or a single test method at run time
  when the test suite is run with AOT optimizations enabled -- only
  applicable to JUnit Jupiter based tests.

Closes gh-30834
2023-10-15 19:22:26 +02:00
Sébastien Deleuze 63a20be502 Optimize Hibernate native footprint by making ByteBuddy unreachable
As a workaround before a proper solution the Spring team is trying to
find with the Hibernate team in a future version of Hibernate, this
commit introduces 2 GraalVM substitutions that should allow to remove
ByteBuddy reachability with Hibernate 6.3.

Closes gh-29549
2023-09-01 12:29:16 +02:00
Sam Brannen e0c3b1ae1d Merge branch '6.0.x' 2023-08-26 15:28:50 +02:00
Sam Brannen 7598bca799 Revise Checkstyle rules to prohibit use of assertions other than AssertJ
Closes gh-31116
2023-08-26 15:28:25 +02:00
Sam Brannen 6a6dd599a1 Remove duplicate Checkstyle suppressions 2023-05-10 14:31:24 +02:00
Juergen Hoeller 697d5e6247 Configuration options for virtual threads (on JDK 21)
VirtualThreadDelegate built on JDK 21 for multi-release jar.
Includes dedicated VirtualThreadTaskExecutor as lean option.
Includes setVirtualThreads flag on SimpleAsyncTaskExecutor.
Includes additional default methods on AsyncTaskExecutor.

Closes gh-30241
2023-05-08 11:22:47 +02:00
Sam Brannen 9cf7b0e230 Polishing 2023-03-12 18:38:50 +01:00
Sam Brannen 99e54fec3a Ensure all packages declare package-info.java with null-safety annotations
This commit picks up where the two previous commits left off.

Specifically, this commit:

- Removes the "severity=warning" configuration to ensure that violations
  actually fail the build.
- Fixes regular expressions for suppressions by matching forward
  slashes using `[\\/]` instead of `\/`.
- Moves the configuration for newly introduced checks to locations in
  checkstyle.xml that align with the existing organization of that file.
- Renames the IDs for RegexpSinglelineJava checks from
  javaDocPackageNonNullApiAnnotation/javaDocPackageNonNullFieldsAnnotation
  to packageLevelNonNullApiAnnotation/packageLevelNonNullFieldsAnnotation,
  respectively, since these checks are not related to Javadoc.
- Simplifies the null-safety annotation checks to match against
  imported annotation types, which enforces consistency across
  package-info.java files for the annotation declarations.
- Simplifies the RegEx for JavadocPackage suppressions to only exclude
  packages not under src/main/java (vs src/main) and those in the
  framework-docs module.
- Consistently suppresses all checks for the `asm`, `cglib`, `objenesis`,
  and `javapoet` packages in spring-core.
- Adds explicit suppressions for null-safety annotations for the `lang`
  package in spring-core.
- Adds explicit suppressions for null-safety annotations for the
  `org.aopalliance` package in spring-aop.
- Revises the RegEx for null-safety annotation suppressions to only
  exclude package-info.java files not under src/main/java and
  additionally to exclude package-info.java files in the framework-docs
  module as well as those in the spring-context-indexer,
  spring-instrument, and spring-jcl modules.
- Adds all missing package-info.java files.
- Adds null-safety annotations to package-info.java files where
  appropriate.

Closes gh-30069
2023-03-10 17:33:52 +01:00
Ed .d 7e32f504b0 Configure Checkstyle to require package-level null-safety annotations
This commit updates the project's checkstyle configuration to check
that package-info.java files contain the @NonNullApi and @NonNullFields
null-safety annotations.

See gh-30069
2023-03-10 16:12:07 +01:00
Ed .d 268e3fec99 Configure Checkstyle to require package-info.java files
This commit updates the project's checkstyle configuration to require
the existence of a package-info.java file for all packages within the
src/main directory while excluding the framework-docs module and
certain packages inside the spring-core module. A missing
package-info.java file will result in emitting a warning.

See gh-30069
2023-03-10 16:09:17 +01:00
Brian Clozel 8b110c9971 Reinstate checkstyle for reference docs code snippets
This commit also ensures that checks are performed before the
application is rendered to get early feedback on errors.
2022-11-25 17:32:59 +01:00
Brian Clozel acd9016fc3 Create framework-docs module
This commit creates a new "framework-docs" module, which is dedicated to
documentation generation (reference and API docs).
This commit refactors the build configuration and moves the asciidoc
files to a separate location, but does not change the name nor the
nature of published artifacts.

Closes gh-29417
2022-11-02 10:59:12 +01:00
Arjen Poutsma 6e9fbcc243 Improve PartEvent documentation
Add note about the necessity of consuming the PartEvent content.

See gh-29400
2022-11-01 17:20:01 +01:00
Johnny Lim 85d029f7c3 Polishing
Closes gh-29410
2022-11-01 15:22:49 +01:00
rstoyanchev e71057dca9 Support i8n of ProblemDetail "title" field
Closes gh-29407
2022-11-01 12:42:34 +00:00
Sébastien Deleuze bf3b7b82c1 Merge branch '5.3.x' 2022-10-31 09:07:52 +01:00
David Costanzo e1df056059 Fix typo: "as describe in" -> "as described in" 2022-10-31 09:07:39 +01:00
Stephane Nicoll 68246dc72c Initiate Ahead of Time chapter
See gh-29350
2022-10-20 10:13:05 +02:00
rstoyanchev d4f7484252 Add Builder to RSocketServiceProxyFactory
RSocketServiceProxyFactory now support programmatic initialization
through a builder, while bean-style initialization is deprecated.

Closes gh-29296
2022-10-19 14:36:45 +01:00
rstoyanchev 5cb3af708c Add Builder to HttpServiceProxyFactory
HttpServiceProxyFactory now support programmatic initialization through
a builder, while bean-style initialization is deprecated.

See gh-29296
2022-10-17 12:23:58 +01:00
Sébastien Deleuze 581fa1419f Merge branch '5.3.x' 2022-10-16 20:32:52 +02:00
Sébastien Deleuze 1439c5bb8f Document how to use WebJars without webjars-locator-core dependency
Closes gh-29322
2022-10-16 20:28:57 +02:00
Arjen Poutsma dedcb19f44 Document PartEvent API
Closes #29170
2022-10-11 16:28:41 +02:00
rstoyanchev cf2b1020f4 Update table of supported controller method return types
Closes gh-28814
2022-10-11 15:10:30 +01:00
rstoyanchev 04f0f1ddb0 Update table of supported controller method return types
See gh-27052
2022-10-11 14:38:38 +01:00
Sam Brannen b3afafbf5a Merge branch '5.3.x' 2022-10-07 18:02:25 +02:00
Sam Brannen a599601dd9 Document how to switch to the default set of TestExecutionListeners
Closes gh-29281
2022-10-07 17:58:22 +02:00
Iain Henderson b8243e6f84 Support CBOR and Protobuf with Kotlin Serialization
This commit introduces support for CBOR and Protobuf using Kotlin
serialization. Support comes in the form of Encoder/Decoder as well
as HttpMessageConverters. Seperate abstract base classes supply support
for binary and string (de)serialization.

The exising JSON codecs and message converters have been migrated to
use the new base classes.

Closes gh-27628
2022-10-06 13:51:50 +02:00
rstoyanchev b6c2e8de23 Support context propagation for Spring MVC controllers
Closes gh-29056
2022-10-06 12:43:54 +01:00
rstoyanchev 6b0f29a065 Document i8n for RFC 7807 problem details
Expand the documentation for error responses and add details on
using a MessageSource to customize and internationalize error details.

See gh-28814
2022-10-05 14:02:42 +01:00
rstoyanchev 75dea98811 Revise docs on RFC 7807
See gh-28814
2022-10-05 14:02:42 +01:00
Sam Brannen ddc7aef51b Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/io/support/PathMatchingResourcePatternResolverTests.java
2022-10-04 14:31:43 +02:00
Sam Brannen fee38175b3 Revert "Test encoding and Unicode normalization for scanned resources"
This reverts commit eb2c1cbcd4.
2022-10-04 14:29:22 +02:00
Sam Brannen 5b08bc29b1 Merge branch '5.3.x' 2022-10-04 13:21:30 +02:00
Sam Brannen eb2c1cbcd4 Test encoding and Unicode normalization for scanned resources
This commit introduces tests which serve as "regression tests" for the
behavior of PathMatchingResourcePatternResolver in Spring Framework
5.3.x with regard to URL-encoding and Unicode normalization of resource
paths.

Specifically, the new tests demonstrate that resource paths do NOT need
to be decoded or normalized in 5.3.x.

See gh-29243
2022-10-04 13:19:59 +02:00
Brian Clozel 8e24797d37 Merge branch '5.3.x' 2022-09-30 14:42:00 +02:00
Brian Clozel 777caef4f7 Upgrade to Gradle 7.5.1 2022-09-30 14:35:31 +02:00
rstoyanchev 9eaae0fe04 Polishing contribution and Theme deprecation notices
Closes gh-28870
2022-09-28 16:22:45 +01:00
Brian Clozel e8d24ae693 Fix HTTP interface section title in ref docs 2022-09-26 13:39:51 +02:00
Stephane Nicoll 5275be3adf Merge branch '5.3.x' 2022-09-26 08:50:58 +02:00
inaba jun ddef70935a Fix MockMvc sample setup
See gh-29201
2022-09-26 08:50:01 +02:00
rstoyanchev 74df50c906 Polishing ProblemDetail Javadoc 2022-09-23 16:54:02 +01:00
Phillip Webb cc7552ec61 Rename @CompileWithTargetClassAccess
Rename `@CompileWithTargetClassAccess` to
`@CompileWithForkedClassLoaderClassLoader`.

Closes gh-29173
2022-09-19 22:29:40 -07:00
Brian Clozel 3e41d7f23e Remove extra asciidoctor configuration
See gh-29162
2022-09-19 13:00:42 +02:00
Sam Brannen 6d5fa89efe Remove Caucho exclusion for main
See gh-28876
2022-09-14 17:18:40 +02:00