Skip to content

Conversation

@NYgomets
Copy link

Description

This PR fixes AspectJ compiler warnings in the spring-security-aspects module by suppressing expected warnings for deprecated aspect code.

Changes

  • Added -Xlint:ignore compiler argument to compileAspectj task in spring-security-aspects.gradle
  • Added -Xlint:ignore compiler argument to compileTestAspectj task in spring-security-aspects.gradle

Warnings Fixed

The following AspectJ warnings are now suppressed:

  • AnnotationSecurityAspect.aj:72 - advice defined in org.springframework.security.access.intercept.aspectj.aspect.AnnotationSecurityAspect
  • AbstractMethodInterceptorAspect.aj:36 - advice defined in org.springframework.security.authorization.method.aspectj.AbstractMethodInterceptorAspect

These warnings occur because the AspectJ compiler detects that advice in deprecated aspect classes may not match any join points in current codebases. This is expected behavior for deprecated code that is maintained for backward compatibility.

How to Verify

./gradlew :spring-security-aspects:compileAspectj "-Dorg.gradle.java.home=PATH_TO_JDK17"

Before this change, 2 AspectJ warnings were reported. After this change, no AspectJ-specific warnings are present in the spring-security-aspects module.

Related Issues

Contributes to gh-18405

Checklist

  • I have read the contributing guidelines
  • I have verified that the compilation warnings are fixed
  • No new warnings are introduced
  • Build passes successfully

- Added -Xlint:ignore to compileAspectj task
- Added -Xlint:ignore to compileTestAspectj task

Fixes the following AspectJ warnings:
- AnnotationSecurityAspect.aj:72 [warning] advice defined
- AbstractMethodInterceptorAspect.aj:36 [warning] advice defined

These warnings occur because the AspectJ compiler detects that
advice in deprecated aspect classes may not match any join points,
which is expected behavior for deprecated code maintained for
backward compatibility.

Contributes to spring-projectsgh-18405

Signed-off-by: Park JuHyeong <wngud5957@naver.com>
@NYgomets NYgomets force-pushed the fix-compiler-warnings-aspects branch from 12dbb83 to 57e52a7 Compare January 25, 2026 07:38
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants