Skip to content

Add TestCompiler deprecation warning shortcut#36824

Open
Will-thom wants to merge 1 commit into
spring-projects:mainfrom
Will-thom:fix/testcompiler-deprecation-warnings
Open

Add TestCompiler deprecation warning shortcut#36824
Will-thom wants to merge 1 commit into
spring-projects:mainfrom
Will-thom:fix/testcompiler-deprecation-warnings

Conversation

@Will-thom
Copy link
Copy Markdown

This adds a focused TestCompiler shortcut for failing compilation when generated code uses deprecated APIs without suppressing the corresponding compiler warning.

Specifically, failOnDeprecationWarning() enables -Xlint:deprecation, -Xlint:removal, and -Werror, which lets AOT-related tests assert deprecation/removal cleanliness without failing on unrelated warning categories.

Closes gh-36036

Tests:

  • ./gradlew.bat --no-daemon :spring-core-test:test --tests org.springframework.core.test.tools.TestCompilerTests
  • ./gradlew.bat --no-daemon :spring-core-test:test --tests org.springframework.core.test.tools.TestCompilerTests :spring-beans:test --tests org.springframework.beans.factory.aot.CodeWarningsTests
  • ./gradlew.bat --no-daemon :spring-core-test:check :spring-beans:check

Closes spring-projectsgh-36036

Signed-off-by: Will-thom <116388885+Will-thom@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 21, 2026
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) status: waiting-for-triage An issue we've not yet triaged or decided on theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add shortcut to fail compilation when calling deprecated code without it being suppressed

3 participants